package yukicoder; import java.util.Arrays; import java.util.Scanner; public class Main{ public static void main(String[] args)throws Exception{ new Main().solve(); } void solve(){ Scanner sc=new Scanner(System.in); int[] l=new int[3]; for(int i=0;i<3;i++)l[i]=sc.nextInt(); int[] d=new int[3]; for(int i=0;i<3;i++)d[i]=sc.nextInt(); Arrays.sort(d); int s_sum=l[0]+l[1]+l[2]; for(int i=0;i<3;i++)l[i]=2*(s_sum-l[i]); Arrays.sort(l); int ans=0; for(int i=0;i<3;i++)ans+=l[i]*d[2-i]; System.out.println(ans); } }