#include using namespace std; using ll = long long; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b void vprint(T &V){ for(auto v : V){ cout << v << " "; } cout << endl; } int main(){ cin.tie(0); ios::sync_with_stdio(false); // input vector L(3); FOR(i, 0, 3){ cin >> L[i]; } sort(ALL(L)); ll R, B, Y; cin >> R >> B >> Y; ll min_len = inf; do{ ll len = 0; len += R * (L[0] + L[1]) * 2; len += B * (L[1] + L[2]) * 2; len += Y * (L[2] + L[0]) * 2; chmin(min_len, len); }while(next_permutation(ALL(L))); p(min_len); return 0; }