Program a170;
var x:array[1..10] of integer;
i,n,j,l,k,s,t:integer;
begin read(n);
for i:=1 to n do read (x[i]);
s:=0;
for i:=2 to n do t:=0;
for j:=2 to x[i]-1 do if x[i] mod j = 0 then begin t:=1; if t=0 then l:=j;
for i:=n to 2 do t:=0;
for j:=2 to x[i]-1 i do if x[i] mod j = 0 then t::=1 else if t:=0 then k:=j;
write(s:=(k+1)+(l-1));
end;
end.




Մեջբերել
Էջանիշներ