x, y, z = map(int, input().split()) ans = 0 if x >= y: ans += y x -= y y = 0 dif = x else: ans += x y -= x x = 0 dif = y if dif >= z: ans += z else: ans += dif z -= dif ans += z // 2 print(ans)