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