Program z1;
var a, i, z, x, y, l: integer;
mas: array [1..10] of integer;
begin
for l:=1 to 10 do
readln(mas[l]);
i:=0;
for a:=1 to 10 do
if mas[a]>1 then i:=i+1;
if i > 0 then begin
z:=0;
for x:=1 to 10 do z:=z+mas[x];
writeln(z);
end
else begin
y:=1;
for x:=1 to 10 do y:=y*mas[x];
writeln(y);
end;
end.