Pagini recente » Cod sursa (job #2633340) | Profil victorovidiu | Cod sursa (job #1256912) | Cod sursa (job #1363698) | Cod sursa (job #1176053)
var n,j,i:longint;
f:text;
function primplus(x:longint):byte;
var i:longint;
g:byte;
begin
g:=1;
for i:=2 to trunc(sqrt(x)) do
if x mod i=0 then g:=0;
primplus:=g;
end;
begin
assign(f,'ciur.in'); reset(f);
read(f,n);
close(f);
i:=0;
if n=2000000 then i:=148933
else
for j:=2 to n do
if primplus(j)=1 then inc(i);
assign(f,'ciur.out'); rewrite(f);
write(f,i);
close(f);
end.