import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int L1 = scan.nextInt(); int L2 = scan.nextInt(); int L3 = scan.nextInt(); int R = scan.nextInt(); int B = scan.nextInt(); int Y = scan.nextInt(); scan.close(); int[]k = new int[3]; k[0] = 2 * (L1 + L2); k[1] = 2 * (L1 + L3); k[2] = 2 * (L2 + L3); int[][] a = {{0, 1, 2}, {0, 2, 1}, {1, 0, 2}, {1, 2, 0}, {2, 0, 1}, {2, 1, 0}}; int min = Integer.MAX_VALUE; for(int i = 0; i < 6; i++) { int t = R * k[a[i][0]] + B * k[a[i][1]] + Y * k[a[i][2]]; if(min > t) { min = t; } } System.out.println(min); } }