Type
Tmas = array [1..100] of longint;
var
m: Tmas;
i, j, proiz, N, sohr: longint;
begin
proiz := 0;
readln(N);
for i := 1 to N do
begin
readln(m[i]);
sohr := m[i];
for j := 1 to sohr - 1 do
begin
m[i] := m[i] * sohr;
end;
proiz := proiz + m[i];
end;
writeln(proiz);
end.