import java.util.*; import java.io.*; import java.math.*; public class No268 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[] l = {sc.nextInt(), sc.nextInt(), sc.nextInt()}; // int l1 = sc.nextInt(), l2 = sc.nextInt(), l3 = sc.nextInt(); int r = sc.nextInt(), b = sc.nextInt(), y = sc.nextInt(); int ans = Integer.MAX_VALUE; for(int i = 0; i < 3; i++) { int t = 0; t +=(l[0]+l[2])*2*r + (l[1]+l[2])*2*b + (l[1]+l[0])*2*y; ans = Math.min(ans, t); int k; k = l[0]; l[0] = l[1]; l[1] = l[2]; l[2] = k; } System.out.println(ans); } }