#include using namespace std; signed main(){ int L1, L2, L3; cin >> L1 >> L2 >> L3; int X[ 3 ]; cin >> X[ 0 ] >> X[ 1 ] >> X[ 2 ]; sort( X, X + 3 ); int w[ 3 ] = { L1 + L2, L2 + L3, L3 + L1 }; sort( w, w + 3, greater< int >() ); cout << 2 * ( X[ 0 ] * w[ 2 ] + X[ 1 ] * w[ 1 ] + X[ 2 ] * w[ 0 ] ) << endl; return 0; }