{-------------------------------
 Nayti proizvedenie cifr
 zadannogo 4-x zna4nogo 4isla.
 -------------------------------
  # Max Tkachenko # Group 112 #
 -------------------------------
}

Program task_3_28___I(input,output);

 var
  a : integer;
  i : integer;


 begin
  writeln('Input A:');
   readln(a);

    {t.k. a - 4-x zna4noe, to zabotitsa o znake porizvedenia ne sleduet}
    a := (a mod 10) * ((a mod 100) div 10) *
         ((a mod 1000) div 100) * ((a mod 10000) div 1000);

  writeln(a);
  readln;
 end.