var
a:array of real;
n,i:integer;
sum:real;
function isP(x:integer):boolean;
k,count:integer;
begin
k:=2;
while (sqr(k)<=x) and (count=0) do
if x mod k=0 then inc(count);
inc(k);
end;
isP:=(count=0);
write('n: '); readln(n);
setlength(a,n);
sum:=0;
for i:=0 to n-1 do
readln(a[i]);
if (i+1>1) then
if isP(i+1) then
sum:=sum+a[i];
writeln('sum: ',sum);
end.
var
a:array of real;
n,i:integer;
sum:real;
function isP(x:integer):boolean;
var
k,count:integer;
begin
k:=2;
while (sqr(k)<=x) and (count=0) do
begin
if x mod k=0 then inc(count);
inc(k);
end;
isP:=(count=0);
end;
begin
write('n: '); readln(n);
setlength(a,n);
sum:=0;
for i:=0 to n-1 do
begin
readln(a[i]);
if (i+1>1) then
if isP(i+1) then
sum:=sum+a[i];
end;
writeln('sum: ',sum);
end.