#include int combi(int n, int r){ long long p = 1; for(int i = 1;i <= r;i++) p = p*(n-i+1)/i; return p; } main(){ int count[26]; for(int i = 0;i < 26;i++){ scanf("%d",&count[i]); } int max = 0; for(int i = 2;i < count['l'-'a'];i++){ max = std::max(max,combi(i,2)*(count['l'-'a']-i)); } long long sum = 1; sum *= count['h'-'a']; sum *= count['e'-'a']; sum *= max; sum *= (count['o'-'a']/2)*(count['o'-'a']/2+count['o'-'a']%2); sum *= count['w'-'a']; sum *= count['r'-'a']; sum *= count['d'-'a']; printf("%lld\n",sum); }