Program Zif_3_28_i(input,output);
VAr a:integer;
begin
     read(a);
     write((a div 1000)*(a mod 10)*(a div 100 mod 10)*(a div 10 mod 10))
end.