#include #define mp make_pair #define mt make_tuple #define pb push_back #define rep(i,n) for(int i=0;i<(n);i++) using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair pii; typedef pair pll; const int INF=1<<29; const double EPS=1e-9; const int MOD = 100000007; const int dx[]={1,0,-1,0},dy[]={0,-1,0,1}; vector L; vector ribon; int main(){ L.resize(3); ribon.resize(3); for (int i = 0; i < 3; i++){ cin >> L[i]; } for (int i = 0; i < 3; i++){ cin >> ribon[i]; } sort(L.begin(), L.end()); int ans = INF; do{ int res = 0; res += (2 * L[0] + 2 * L[1]) * ribon[0]; res += (2 * L[1] + 2 * L[2]) * ribon[1]; res += (2 * L[0] + 2 * L[2]) * ribon[2]; ans = min(ans, res); }while(next_permutation(L.begin(), L.end())); cout << ans << endl; }