import java.util.*; import java.io.*; import java.math.*; public class Main { static int R; static int B; static int Y; public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[] l = new int[3]; l[0] = sc.nextInt(); l[1] = sc.nextInt(); l[2] = sc.nextInt(); R = sc.nextInt(); B = sc.nextInt(); Y = sc.nextInt(); int min = check(l,new boolean[3],new int[3],0); System.out.println(min); } static int check(int[] a, boolean[] b, int[] c, int d) { if(d == 3) { return c[0] * 2 * R + c[2] * 2 * R + c[0] * 2 * B + c[1] * 2 * B + c[1] *2 * Y + c[2] * 2 * Y; } int min = Integer.MAX_VALUE; for(int i = 0; i < 3; i++) { if(b[i]) continue; b[i] = true; c[d] = a[i]; min = Math.min(check(a,b,c,d+1), min); b[i] = false; c[d] = 0; } return min; } }