#include using namespace std; pair calc(int a){ pair p; int b=0,bf=0,bs=0; for(int i=2;i<=a-1;++i){ int c=i*(i-1)/2; int d=a-i; int e=c*d; if(b>ary_in[i]; } int ary_word[26]; for(int i=0;i<26;++i){ ary_word[i]=0; } char ca='h'; int a=ca; a-=97; ary_word[a]=1; char cb='e'; int b=cb; b-=97; ary_word[b]=1; char cc='l'; int c=cc; c-=97; ary_word[c]=3; char cd='o'; int d=cd; d-=97; ary_word[d]=2; char ce='w'; int e=ce; e-=97; ary_word[e]=1; char cf='r'; int f=cf; f-=97; ary_word[f]=1; char cg='d'; int g=cg; g-=97; ary_word[g]=1; int ary_diff[26]; for(int i=0;i<26;++i){ ary_diff[i]=ary_in[i]-ary_word[i]; } int ans=1; for(int i=0;i<26;++i){ if(ary_diff[i]<0) ans=0; } if(ans>0){ int a2=ary_in[a]; int b2=ary_in[b]; int c2=ary_in[c]; pair p=calc(c2); int c2_1=p.first; int c2_2=p.second; int d2=ary_in[d]; int d2_1=d2/2; int d2_2=d2-d2_1; int e2=ary_in[e]; int f2=ary_in[f]; int g2=ary_in[g]; ans=a2*b2*c2_1*c2_2*d2_1*d2_2*e2*f2*g2; } cout<