Program spell;
Var a,b,c,d:word;
    f,g:text;
Begin
 assign(f,'spell.in');
 reset(f);
 readln(f,a,b,c,d);
 close(f);
 assign(g,'spell.out');
 rewrite(g);
 if (a > c) and (b > c) and (c > d) then write(g,a * b + c * d);
 if (a > d) and (b > d) and (d > c) then write(g,a * b + c * d);
 if (a > d) and (c > d) and (d > b) then write(g,a * c + d * b);
 if (a > b) and (c > b) and (b > d) then write(g,a * c + d * b);
 if (a > b) and (d > b) and (b > c) then write(g,a * d + b * c);
 if (a > c) and (d > c) and (c > b) then write(g,a * d + b * c);
 if (b > a) and (c > a) and (a > d) then write(g,b * c + a * d);
 if (b > d) and (c > d) and (d > a) then write(g,b * c + a * d);
 if (b > a) and (d > a) and (a > c) then write(g,b * d + a * c);
 if (b > c) and (d > c) and (c > a) then write(g,b * d + a * c);
 if (c > a) and (d > a) and (a > b) then write(g,c * d + a * b);
 if (c > b) and (d > b) and (b > a) then write(g,c * d + a * b);
 close(g);
End.