#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include typedef long long ll; using namespace std; typedef pair P; int main() { int a,b,c; int red,blue,yellow; cin>>a>>b>>c>>red>>blue>>yellow; vector around; around.push_back(2*a+2*b); around.push_back(2*a+2*c); around.push_back(2*b+2*c); sort(around.begin(),around.end()); vector rby; rby.push_back(red); rby.push_back(blue); rby.push_back(yellow); sort(rby.begin(),rby.end(),greater()); int ans=0; for(int i=0; i<3;i++){ ans = ans+ around[i]*rby[i]; } cout<