#include <iostream>

using namespace std;

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