Pagini recente » Cod sursa (job #1199706) | Cod sursa (job #2848034) | Cod sursa (job #1261069) | Cod sursa (job #2281174) | Cod sursa (job #1198866)
var b:array[2..2000001] of boolean;
i,j: longint;
t: text;
s,n: longint;
begin
assign(t,'ciur.in');
reset(t);
readln(t,n);
close(t);
j:=1;s:=0;
while (sqr(j)<=n) do begin
inc(j);
if not(b[j]) then begin
i:=sqr(j);
while (i<n) do begin
b[i]:=true;
i:=i+j;
end;
end;
while (j<n) do begin
inc(j);
if not(b[j]) then inc(s);
end;
if not(b[j]) then inc(s);
end;
assign(t,'ciur.out');
rewrite(t);
writeln(t,s);
close(t);
end.