uses crt;
var a:array[1..100]of integer;
i,n,dem,kt,j,t:integer;
begin
clrscr;
readln(n);
for i:=1 to n do
begin
readln(a[i]);
end;
dem:=0;
t:=0;
for i:=1 to n do
if a[i]>1 then
begin
kt:=0;
for j:=2 to trunc(sqrt(a[i])) do
if a[i] mod j=0 then
begin
kt:=1;
break;
end;
if kt=0 then
begin
inc(dem);
t:=t+a[i];
write(a[i]:4);
end;
end;
writeln;
writeln('So luong la:',dem);
writeln('Tong la: ',t);
readln;
end.