Pagini recente » Cod sursa (job #209047) | Cod sursa (job #1040556) | Cod sursa (job #2313819) | Cod sursa (job #2160356) | Cod sursa (job #587063)
Cod sursa(job #587063)
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);
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.