using static System.Math; using System; public class Hello { static void Main() { string[] line = Console.ReadLine().Trim().Split(' '); var a = int.Parse(line[0]); var b = int.Parse(line[1]); var c = int.Parse(line[2]); var dif = Abs(a - b); if (c < dif) Console.WriteLine(Min(a, b) + c); else Console.WriteLine(Max(a, b) + (c - dif) / 2); } }