thienan2012
:
Var n,i,j:longint;
S:int64;
KT:Boolean;
A:array[1..100000] of int64;
Begin
Readln(n);
For i:=1 to n do Read(A[i]);
For i:=1 to n do
Begin
j:=2;
KT:=True;
While (j<=trunc(sqrt(A[i]))) and (KT=True) do
Begin
If A[i] mod j=0 then KT:=False;
inc(j);
end;
If (KT=True) and (A[i]>1) then S:=S+A[i];
end;
Writeln(S);
Readln;
readln
end.