Pagini recente » Cod sursa (job #1651220) | Cod sursa (job #2967038) | Cod sursa (job #617646) | Cod sursa (job #171670) | Cod sursa (job #587062)
Cod sursa(job #587062)
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:=3*(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.