import java.util.*; import java.math.*; import java.text.*; public class Main { private static Scanner sc = new Scanner(System.in); public static void main(String[] args) throws Exception { int l1 = sc.nextInt(); int l2 = sc.nextInt(); int l3 = sc.nextInt(); int r = sc.nextInt(); int b = sc.nextInt(); int y = sc.nextInt(); int ret = Integer.MAX_VALUE; ret = Math.min(ret, sum(l1, l2, l3, r, b, y)); ret = Math.min(ret, sum(l1, l3, l2, r, b, y)); ret = Math.min(ret, sum(l2, l1, l3, r, b, y)); ret = Math.min(ret, sum(l2, l3, l1, r, b, y)); ret = Math.min(ret, sum(l3, l1, l2, r, b, y)); ret = Math.min(ret, sum(l3, l2, l1, r, b, y)); System.out.println(ret); } public static int sum(int l1, int l2, int l3, int r, int b, int y) { return (l2+l3)*2*r + (l1+l2)*2*b + (l1+l3)*2*y; } }