Pagini recente » Cod sursa (job #2234857) | Cod sursa (job #1038081) | Cod sursa (job #569852) | Cod sursa (job #2492785) | Cod sursa (job #1319896)
const fi='ciur.in';
fo='ciur.out';
nm=2000010;
var p:array[0..nm] of byte;
n:longint;
i,j,sol:longint;
procedure ciur;
begin
for i:=2 to n do begin
if p[i]=0 then begin
inc(sol);
j:=i;
while j<=n do begin
p[j]:=1;inc(j,i);end;
end;
end;
end;
begin
assign(input,fi);reset(input);
readln(n);close(output);
sol:=0;
assign(output,fo);rewrite(output);
ciur;
write(sol);
close(output);
end.