input_list = list(map(int,input().split())) x = input_list[0] y = input_list[1] z = input_list[2] res = 0 def min(a, b): if a >= b: return b else: return a # 赤と青の差を白で埋める delta = x - y change = min(abs(delta), z) if delta > 0: y += change z -= change elif delta < 0: x += change z -= change res += min(x, y) # 残った白で紫を作る res += int(z / 2) print(res)