using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ForYukicoder { class Program { static void Main(string[] args) { string[] a = Console.ReadLine().Split(); int w = int.Parse(a[0]); int h = int.Parse(a[1]); int d = int.Parse(a[2]); int[] box = { (h + d) * 2, (w + h) * 2, (w + d) * 2 }; var C = ConvertStringArrayToIntArray(Console.ReadLine().Split()); Array.Sort(box); Array.Sort(C); int sum = box[2] * C[0] + box[1] * C[1] + box[0] * C[2]; Console.WriteLine(sum); } static int[] ConvertStringArrayToIntArray(string[] array) { return Array.ConvertAll(array, str => int.Parse(str)); } } }