#include #define PB push_back #define MP make_pair #define REP(i,n) for (int i=0;i<(n);i++) #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define ALL(a) (a).begin(),(a).end() using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair P; const int INF=1e9; int main(){ int l[3]; vector a,b(3); REP(i,3)cin>>l[i]; REP(i,3)cin>>b[i]; REP(i,3)a.PB(l[i]+l[(i+1)%3]); sort(ALL(a)); sort(ALL(b),greater()); int ans=0; REP(i,3)ans+=a[i]*b[i]*2; cout<