#include #include #define pb push_back #define mp make_pair #define ld long double #define ll long long #define ull unsigned long long using namespace std; #define f cin #define g cout //ifstream f(".in"); //ofstream g(".out"); int main() { int v[10],sol=0; for(int i=1;i<=4;++i)scanf("%d",&v[i]); sort(v+1,v+1+4); do { sol=max(sol,v[1]*v[2]+v[3]*v[4]); }while(next_permutation(v+1,v+1+4)); printf("%d\n",sol); //f.close();g.close(); return 0; }