#include <iostream>
#include <algorithm>
using namespace std;

int main()
{
    int v[4];
    cin >> v[1] >> v[2] >> v[3] >> v[4];
    sort(v + 1,v + 4 + 1);
    cout << v[1]*v[2] + v[3]*v[4];
    return 0;
}