#include #include #include using namespace std; vector v; int main(){ int a; scanf("%d",&a); v.push_back(a); scanf("%d",&a); v.push_back(a); scanf("%d",&a); v.push_back(a); scanf("%d",&a); v.push_back(a); sort(v.begin(),v.end()); printf("%d",v[0]*v[1]+v[2]*v[3]); return 0; }