Pagini recente » Cod sursa (job #213766) | Cod sursa (job #2104428) | Cod sursa (job #2480740) | Rating Iosub Raluca Nicoleta (RalucaIosub) | Cod sursa (job #410825)
Cod sursa(job #410825)
const tfi='ciur.in';
tfo='ciur.out';
maxn=2000005;
var fi,fo:text;
cnt, i,j,n:longint;
dd:array[0..maxn] of longint;
begin
assign(fi,tfi); reset(fi);
assign(fo,tfo); rewrite(fo);
read(fi,n);
for i:=2 to trunc(sqrt(n)) do
if dd[i]=0 then
begin
j:=i;
while i+j<=n do
begin
j:=i+j; dd[j]:=1;
end;
end;
j:=0;
for i:=2 to n do
if dd[i]=0 then inc(j);
writeln(fo,j);
close(Fi); close(fo);
end.