#include using namespace std; int main() { int a[5],i,aux,j; cin>>a[1]>>a[2]>>a[3]>>a[4]; for(i=1;i<=4;i++) for(j=i+1;j<=4;j++) if (a[i]>a[j]) { aux=a[i]; a[i]=a[j]; a[j]=aux; } aux=(a[1]*a[2])+(a[3]*a[4]); cout<