import java.io.*; class Main{ static final PrintWriter out=new PrintWriter(System.out); public static void main(String[] arg) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); int[] a=new int[27]; for(int i=1;i<=26;i++) a[i]=Integer.parseInt(br.readLine()); int d=a[4]; int e=a[5]; int h=a[8]; int l=a[12]; int o=a[15]; int r=a[18]; int w=a[23]; int o1=o/2; o=o1*(o-o1); long l1=0; if(l>=3){ for(int i=2;i<=l-1;i++) l1=Math.max(l1,combination(i,2)*(l-i)); } else l1=0; out.println(d*e*h*l1*o*r*w); out.flush(); } private static long combination(int a,int b){ if(b==0||b==a) return 1; if(b==a-1||b==1) return a; if(a/2>=b) return fact(a,b+1)/fact(a-b,1); else return combination(a,a-b); } private static long fact(int a,int b){ if(a==b) return b; return a*fact(a-1,b); } }