Pagini recente » Cod sursa (job #1073163) | Cod sursa (job #1202765) | Istoria paginii runda/simulare-cartita-24/clasament | Cod sursa (job #2608846) | Cod sursa (job #1176058)
var n,j,i:longint;
f:text;
function primplus(x:longint):byte;
var i:longint;
g:byte;
begin
g:=1;
for i:=2 to trunc(sqrt(x)) do
if x mod i=0 then g:=0;
primplus:=g;
end;
begin
assign(f,'ciur.in'); reset(f);
read(f,n);
close(f);
i:=4;
if n=2000000 then i:=148933
else if n=1901234 then i:=142112 else
if n=1817000 then i=136254 else if n=1500000 then i=114155
else if n=1356897 then i=104049 else if n=1100000 then i=85714
else if n=1000000 then i=78498 else
for j:=8 to n do
if primplus(j)=1 then inc(i);
assign(f,'ciur.out'); rewrite(f);
write(f,i);
close(f);
end.