#include #include #include using namespace std; int main() { int a, b, c, d; vector v; cin >> a >> b >> c >> d; v.push_back(a); v.push_back(b); v.push_back(c); v.push_back(d); sort(v.begin(), v.end()); cout << v[0] * v[1] + v[2] * v[3]; return 0; }