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