#include #include using namespace std; int main() { //freopen("input", "r", stdin); //freopen("output", "w", stdout); int a[5], smax=0, i; for(i=1;i<5;i++) scanf("%d", &a[i]); sort(a+1, a+5); do { smax=max(smax, a[1]*a[2]+a[3]*a[4]); } while(next_permutation(a+1, a+5)); printf("%d", smax); }