r, b, w = map(int, input().split()) x = abs(r - b) if w > x: w -= x print(max(r, b) + w//2) else: print(min(r, b) + w)