red, blue, white = map(int, input().split(" ")) lower = min(blue, red) rest = abs(blue - red) if rest >= white: print(lower + white) else: print(lower + rest + int((white - rest)//2))