uses crt;
function Prost(a:longint):boolean;
var i:longint;
f:boolean;
begin
f:=true;
for i:=2 to round(sqrt(a)) do
if a mod i=0 then f:=false;
Prost:=f;
end;
var i,m,s:longint;
begin
clrscr;
write('M=');
readln(m);
s:=0;
for i:=2 to m do if not Prost(i) then inc(s,i);
write('s=',s);
readln
end.