#include <iostream>
using namespace std;

int main () {
    int a, b, c, d;
    cin>>a>>b>>c>>d;
    int spellmax, spell;
    spellmax = a*b + c*d;
    spell = a*c + b*d;
    if (spell>spellmax) spellmax = spell;
    spell = a*d + b*c;
    if (spell>spellmax) spellmax = spell;
    cout<<spellmax;
    return 0;
}