#include #include using namespace std; int main() { int v[4]; for (int i = 0; i < 4; ++i) cin >> v[i]; sort(v, v+4); cout << (v[2] * v[3]) + (v[0] * v[1]); return 0; }