#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define all(x) (x).begin(),(x).end() #define rep(i,m,n) for(int i = m;i < n;++i) #define pb push_back #define fore(i,a) for(auto &i:a) #define rrep(i,m,n) for(int i = m;i >= n;--i) #define INF INT_MAX/2 using namespace std; using ll = long long; using R = double; using Data = pair>; const ll MOD = 1e9 + 7; const ll inf = 1LL << 50; struct edge { ll from; ll to; ll cost; }; int main() { ll numh, nume, numl, numo, numw, numr, numd; rep(i, 0, 26) { ll c; cin >> c; switch (i) { case 3: numd = c; case 4: nume = c; case 7: numh = c; case 11: numl = c; case 14: numo = c; case 17: numr = c; case 22: numw = c; } } ll nl = 0; for (ll l = 2; l <= numl - 1; l++) { nl = max(nl, l*(l - 1)*(numl - l) / 2); } cout << numh * nume* nl * (numo / 2)*(numo - numo / 2)*numw*numr*numd << endl; return 0; }