#pragma GCC optimize("O3,unroll-loops") #include using namespace std; typedef long long ll; const int mx = 6001; int main(){ int na, nb, nc; cin >> na >> nb >> nc; vector acl(mx+1), bcl(mx+1), ccl(mx+1); vector acr(mx+1), bcr(mx+1), ccr(mx+1); vector asl(mx+1), bsl(mx+1), csl(mx+1); vector asr(mx+1), bsr(mx+1), csr(mx+1); for (int i=0; i> x; acl[x+3000]++; acr[x+3000+1]++; asl[x+3000]+=x; asr[x+3000+1]+=x; } for (int i=0; i> x; bcl[x+3000]++; bcr[x+3000+1]++; bsl[x+3000]+=x; bsr[x+3000+1]+=x; } for (int i=0; i> x; ccl[x+3000]++; ccr[x+3000+1]++; csl[x+3000]+=x; csr[x+3000+1]+=x; } for (int i=mx; i>=0; i--){ asl[i] += asl[i+1]; bsl[i] += bsl[i+1]; csl[i] += csl[i+1]; acl[i] += acl[i+1]; bcl[i] += bcl[i+1]; ccl[i] += ccl[i+1]; } for (int i=0; i<=mx; i++){ asr[i+1] += asr[i]; bsr[i+1] += bsr[i]; csr[i+1] += csr[i]; acr[i+1] += acr[i]; bcr[i+1] += bcr[i]; ccr[i+1] += ccr[i]; } ll ans = 0; auto calc = [&](int i, int j, bool ix, bool jx){ int asz, bsz, csz; ll asum, bsum, csum; if (!ix){ asz = acl[i]; asum = asl[i]; }else{ asz = acr[i]; asum = asr[i]; } if (!jx){ bsz = bcl[j]; bsum = bsl[j]; }else{ bsz = bcr[j]; bsum = bsr[j]; } if (asz == 0){ csz = ccl[0]; csum = csl[0]; ans = max(ans, asum * bsz + bsum * csz + csum * asz); csz = ccl[mx]; csum = csl[mx]; ans = max(ans, asum * bsz + bsum * csz + csum * asz); }else{ ll t = (- bsum + asz - 1 + abs(bsum) * asz) / asz - abs(bsum); t = min(t, (ll)3000); t = max(t, (ll)-3000); csz = ccl[t+3000]; csum = csl[t+3000]; ans = max(ans, asum * bsz + bsum * csz + csum * asz); csz = ccl[t+3001]; csum = csl[t+3001]; ans = max(ans, asum * bsz + bsum * csz + csum * asz); csz = ccl[max((ll)0, t+3001)]; csum = csl[max((ll)0, t+3001)]; ans = max(ans, asum * bsz + bsum * csz + csum * asz); } }; for (int i=0; i<=mx; i++){ for (int j=0; j<=mx; j++){ calc(i,j,0,0); } } cout << ans << '\n'; }