#define _USE_MATH_DEFINES #include #include #include #include #include #include #include #include #include #include ///////// #define REP(i, x, n) for(int i = x; i < n; i++) #define rep(i,n) REP(i,0,n) #define P(p) cout<<(p)<>C[i]; } LL ans = 1; LL ama = 0; LL big = -1; LL tbig = 0; if(C['e'-'a'] < 1){P(0);return 0;} else{ans *= C['e'-'a'];} if(C['h'-'a'] < 1){P(0);return 0;} else{ans *= C['h'-'a'];} if(C['r'-'a'] < 1){P(0);return 0;} else{ans *= C['r'-'a'];} if(C['w'-'a'] < 1){P(0);return 0;} else{ans *= C['w'-'a'];} if(C['o'-'a'] < 2){P(0);return 0;} else{ ama = C['o'-'a']-2; ans *= (1+ama/2)*(1+ama-ama/2); } if(C['l'-'a'] < 3){P(0);return 0;} else{ ama = C['l'-'a'] - 3 ; for(int k=0;k<=ama;++k){ tbig = ((k+2)*(k+1)/2) * (ama-k+1); if(big == -1 || big < tbig){ big = tbig; } } ans *= big; } P(ans); return 0; }