Pagini recente » Cod sursa (job #2697640) | Cod sursa (job #1296898) | Cod sursa (job #309936) | Cod sursa (job #1314924) | Cod sursa (job #587057)
Cod sursa(job #587057)
var a:array[1..10000001] of byte;
i,n,nr,r:longint;
j,k:int64;
begin
assign(input,'ciur.in');reset(input);
assign(output,'ciur.out');rewrite(output);
readln(n);
nr:=1;
i:=1;r:=1-n mod 2;
n:=n div 2-r;
for i:=1 to n do
if a[i shl 1+1]=0 then
begin
k:=(i shl 1+1)*(i shl 1+1);
j:=k shr 1;
while j<=n do
begin
a[j]:=1;
j:=j+k shr 1;
end;
end;
for i:=1 to n do if a[i]=0 then inc(nr);
write(nr);
end.