using System; public class Hello { public static void Main() { string[] line = Console.ReadLine().Trim().Split(' '); var a2 = Array.ConvertAll(line, int.Parse); var a = new int[3]; a[0] = a2[0] + a2[1]; a[1] = a2[1] + a2[2]; a[2] = a2[2] + a2[0]; line = Console.ReadLine().Trim().Split(' '); var b = Array.ConvertAll(line, int.Parse); Array.Sort(a); Array.Sort(b); var ans = a[0] * b[2] + a[1] * b[1] + a[2] * b[0]; ans *= 2; Console.WriteLine(ans); } }