#include using namespace std; #define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++) #define rep(i,n) repl(i,0,n) #define mp(a,b) make_pair((a),(b)) #define pb(a) push_back((a)) #define all(x) (x).begin(),(x).end() #define uniq(x) sort(all(x)),(x).erase(unique(all(x)),end(x)) #define fi first #define se second #define dbg(x) cout<<#x" = "<<((x))< ostream& operator<<(ostream& o, const pair &p){o<<"("< ostream& operator<<(ostream& o, const vector &v){o<<"[";for(T t:v){o< need(26,0); for(char c : hel) need[c-'a']++; long ans = 1; rep(i,26){ long d; cin>>d; if(need[i]>0){ if(d < need[i]){cout << 0 << endl; return 0;} if(need[i] == d) continue; d -= need[i]; if(i == 'l' - 'a'){ long mx = 1; for(int j=0; j<=d; j++) mx = max(mx, (d+2-j)*(d+1-j)*(1+j)/2); ans *= mx; } else if(i == 'o' - 'a'){ long mx = 1; for(int j=0; j<=d; j++) mx = max(mx, (d+1-j)*(1+j)); ans *= mx; } else { ans *= (d+1); } } } cout << ans << endl; return 0; }