using System; using System.Collections; using System.Collections.Generic; class TEST{ static void Main(){ Sol mySol =new Sol(); mySol.Solve(); } } class Sol{ public void Solve(){ //helloworld //dehllloorw int[] B=new int[26]; String hh="helloworld"; for(int i=0;i1){ if(i==(int)('l'-'a')){ // nC2*mC1 n+m=restのMaxを求める long rest=(long)(A[i]-B[i]); if(rest<0){ cnt*=0; break; } long lmax=-1; for(long j=0;j<=rest;j++){ long l=(2+j)*(2+j-1)/2; l*=(1+rest-j); //Console.WriteLine(l); lmax=Math.Max(lmax,l); } cnt*=lmax; } if(i==(int)('o'-'a')){ // nC1*mC1 n+m=rest+2のMaxを求める long rest=(long)(A[i]-B[i]); if(rest<0){ cnt*=0; break; } long lmax=-1; for(long j=0;j<=rest;j++){ long l=(1+j); l*=(1+rest-j); lmax=Math.Max(lmax,l); } cnt*=lmax; } } } Console.WriteLine(cnt); } int[] A; public Sol(){ A=new int[26]; for(int i=0;i<26;i++){ A[i]=ri(); } } static String rs(){return Console.ReadLine();} static int ri(){return int.Parse(Console.ReadLine());} static long rl(){return long.Parse(Console.ReadLine());} static double rd(){return double.Parse(Console.ReadLine());} static String[] rsa(){return Console.ReadLine().Split(' ');} static int[] ria(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>int.Parse(e));} static long[] rla(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>long.Parse(e));} static double[] rda(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>double.Parse(e));} }