#include using namespace std; #define REP(i,n) for(int i=0; i<(int)(n); i++) int main() { ios_base::sync_with_stdio(0); cin.tie(0); vector x(3), y(3); REP (i, 3) { cin >> x[i]; x[i] *= 2; } REP (i, 3) cin >> y[i]; int sum = accumulate(x.begin(), x.end(), 0); REP (i, 3) x[i] = sum - x[i]; sort(x.begin(), x.end()); sort(y.rbegin(), y.rend()); int ret = 0; REP (i, 3) ret += x[i] * y[i]; cout << ret << endl; return 0; }