using System.Numerics; public class Program { public static void Main() { //int num = int.Parse(Console.ReadLine() ?? string.Empty); string[] str = (Console.ReadLine() ?? string.Empty).Trim().Split(' '); //string str = Console.ReadLine() ?? string.Empty; int one = int.Parse(str[0]); int two = int.Parse(str[1]); int three = int.Parse(str[2]); int b = int.Parse(str[3]); int r = one + two + three + b; int m = three * 3; if(r > m) { Console.WriteLine(r); } else { Console.WriteLine(m); } } }