#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); vector L(3); for (auto &&e : L) { cin >> e; } vector A(3, 0); A[0] = 2 * (L[0] + L[1]); A[1] = 2 * (L[1] + L[2]); A[2] = 2 * (L[2] + L[0]); vector B(3); for (auto &&e : B) { cin >> e; } sort(A.begin(), A.end()); sort(B.begin(), B.end(), greater()); int res = 0; for (int i = 0; i < 3; i++) { res += A[i] * B[i]; } cout << res << '\n'; return 0; }