Program n_1;
var x:integer;
begin
read(x);
if x mod 2 = 1 then writeln((x mod 10) + (x div 10 mod 10) + (x div 100))
else writeln((x mod 10) * (x div 10 mod 10) * (x div 100));
end.
Program n_1;
var x:integer;
begin
read(x);
if x mod 2 = 1 then writeln((x mod 10) + (x div 10 mod 10) + (x div 100))
else writeln((x mod 10) * (x div 10 mod 10) * (x div 100));
end.