#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define RALL(x) (x).rbegin(),(x).rend() #define ALL(x) (x).begin(),(x).end() #define repp(i,n) for(int (i)=1;(i)<=(n);(i)++) #define rep(i,n) for(int (i)=0;(i)<(n);(i)++) #define rev(i,n) for(int (i)=(n-1);(i)>=0;(i)--) #define clr(a) memset((a), 0 ,sizeof(a)) typedef pair P; typedef vector > pii; typedef map mdi; int A[3],B[3]; int main(){ cin >> A[0] >> A[1] >> A[2] >> B[0] >> B[1] >> B[2]; sort(A,A+3); sort(B,B+3,greater()); cout << (2*A[0]+2*A[1])*B[0] + (2*A[0]+2*A[2])*B[1] + (2*A[1]+2*A[2])*B[2] << endl; return 0; }