Pagini recente » Cod sursa (job #2777451) | Cod sursa (job #369322) | Cod sursa (job #1912444) | Cod sursa (job #816767) | Cod sursa (job #1192466)
type stiva=array[2..2000000] of longint;
var st:stiva;f,g:text;i,x,n,nr,t:longint;
function prim(i:longint):boolean;
var nr,j:byte;
begin
nr:=0;
for j:=2 to trunc(sqrt(i)) do
if i mod j =0 then inc(nr);
if nr<>0 then prim:=false
else prim:=true;
end;
begin
assign(f,'ciur.in');
reset(f);
read(f,n);
close(f);nr:=0;
for i:=2 to 10 do
if prim(i) then
begin
t:=1;inc(nr);
repeat
inc(t);
if i*t<=n then st[i*t]:=1;
until i*t>=n;
end;
for i:=11 to n do
if st[i]<>1 then inc(nr);
assign(g,'ciur.out');
rewrite(g);
write(g,nr);
close(g);
end.