#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; int main() { vector numbers; for(int i = 0; i < 4; i++) { int temp = 0; cin >> temp; numbers.push_back(temp); } sort(numbers.begin(), numbers.end()); cout << (numbers[3] * numbers[2]) + (numbers[1] * numbers[0]) << endl; return 0; }