#include #include #include typedef std::int_fast32_t s32; typedef std::uint_fast32_t u32; typedef std::int_fast64_t s64; typedef std::uint_fast64_t u64; const unsigned long mod = 1000000007; int main() { int L[3]; for(int i = 0; i < 3; ++i) { std::cin >> L[i]; } int C[3]; for(int i = 0; i < 3; ++i) { C[i] = (L[i] + L[(i + 1) % 3]) * 2; } std::sort(C, C+3); int T[3]; for(int i = 0; i < 3; ++i) { std::cin >> T[i]; } std::sort(T, T+3); std::reverse(T, T+3); int res = 0; for(int i = 0; i < 3; ++i) { res += C[i] * T[i]; } std::cout << res << std::endl; return 0; }