#include #include using namespace std; int main(){ map mp; for (int i = 0; i < 26; i++){ cin >> mp['a' + i]; } unsigned long long ans = 1; ans *= mp['h']; ans *= mp['e']; ans *= mp['o'] / 2; ans *= mp['w']; ans *= (mp['o'] + 1) / 2; ans *= mp['r']; ans *= mp['d']; int mx = 0; for (int i = 0; i <= mp['l']; i++){ mx = max(mx, i * (i - 1) / 2 * (mp['l'] - i)); } ans *= mx; cout << ans << endl; }