import math as m a, b, c = map(int, input().split()) if c: print(m.floor((a + b + c) / 2)) else: print(min([a, b]))