Pagini recente » Cod sursa (job #1969080) | Cod sursa (job #3158738) | Cod sursa (job #883250) | Cod sursa (job #200272) | Cod sursa (job #2460427)
var a,b,c,d,n,i,p,count,count2,last:longint;
este:boolean;
var x:array[1..2000000] of boolean;
fin,fout:textfile;
begin
assign(fin,'ciur.in');
reset(fin);
assign(fout,'ciur.out');
rewrite(fout);
readln(fin,n);
p:=2;
i:=2;
x[1]:=True;
x[2]:=False;
while n<>p do begin
while i<n do begin
i:=i+p;
if i<> n then x[i]:=True;
end;
for i:=p to n do begin
if (i>p) and (x[i]=False) then begin
last:=p;
p:=i;
break;
end;
end;
i:=p;
end;
for i:=1 to n do
if n mod i=0 then
inc(a);
if a=2 then x[n]:=False
else x[n]:=True;
for i:=1 to n do
if x[i]=False then inc(b);
writeln(b);
end.