#include using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x>C['a'+i]; ll ret=1; ret*=C['h']; ret*=C['e']; ret*=C['r']; ret*=C['w']; ret*=C['d']; if(C['o']<2) _P("0\n"); if(C['l']<3) _P("0\n"); if(ret<=0) _P("0\n"); int ma=0; for(i=1;i<=C['o']-1;i++) ma=max(ma,i*(C['o']-i)/2); ret*=ma; ma=0; for(i=2;i<=C['l']-1;i++) ma=max(i*(i-1)*(C['l']-i)/2,ma); ret*=ma; cout<