#include using namespace std; using Int = long long; template inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template inline void chmax(T1 &a,T2 b){if(a c(n); for(Int i=0;i>c[i]; auto calc=[&](char x){return c[x-'a'];}; Int ans=0; for(Int i=0;i<=calc('l');i++) for(Int j=0;j<=calc('o');j++) chmax(ans,(i*(i-1)/2)*(calc('l')-i)*j*(calc('o')-j)); ans*=calc('h')*calc('e')*calc('w')*calc('r')*calc('d'); cout<