#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"); ret*=(C['o']/2)*(C['o']-(C['o']/2)); int ma=0; for(i=2;i<=C['l']-1;i++) { ma=max(i*(i-1)*(C['l']-i)/2,ma); } ret*=ma; cout<