uses crt;
var n,i,kt,j,t:integer;
begin
clrscr;
write('n='); readln(n);
t:=0;
writeln('cac so nguyen to nho hon hoac bang ',n,' la: ');
for i:=2 to n do
begin
kt:=0;
for j:=2 to i-1 do
if i mod j=0 then kt:=1;
if kt=0 then begin
write(i:4);
t:=t+i;
end;
end;
writeln;
writeln('tong cac so nguyen to nho hon hoac bang ',n,' la: ',t);
readln;
end.