#include #define rep(i,n) for(int i = 0; i < (n); i++) using namespace std; typedef long long ll; int main(){ cin.tie(0); ios::sync_with_stdio(0); int L[3]; rep(i,3) cin >> L[i]; int R,B,Y; cin >> R >> B >> Y; sort(L, L + 3); int ans = 1e9; do { int cur = 0; cur += R * 2 * (L[0] + L[1]); cur += B * 2 * (L[1] + L[2]); cur += Y * 2 * (L[2] + L[0]); ans = min(ans, cur); } while(next_permutation(L, L + 3)); cout << ans << endl; }