#include using namespace std; #define N 26 unsigned long long c[N]; int main() { for ( int i = 0; i < N; i++ ) { cin >> c[i]; } auto x = c['h' - 'a'] * c['e' - 'a'] * c['w' - 'a'] * c['r' - 'a'] * c['d' - 'a']; auto y = c['o' - 'a']; x *= (y / 2) * (y - (y / 2)); auto z = c['l' - 'a']; x *= (z / 3) * (z - (z / 3)) * (z - (z / 3) - 1) / 2; cout << x << endl; return 0; }