import java.util.*; public class Exercise83{ public static void main (String[] args){ Scanner sc = new Scanner(System.in); Integer[] box = new Integer[3]; Integer[] ribbon = new Integer[3]; int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); for(int i = 0; i < ribbon.length; i++){ ribbon[i] = sc.nextInt(); } box[0] = a + b; box[1] = a + c; box[2] = b + c; Arrays.sort(box, Comparator.naturalOrder()); Arrays.sort(ribbon, Comparator.reverseOrder()); int sum = 0; for(int i = 0; i < box.length; i++){ sum += box[i] * 2 * ribbon[i]; } System.out.println(sum); } }