from heapq import * from itertools import * from functools import * from collections import * import sys,math input = sys.stdin.readline X,Y,Z = map(int,input().split()) X,Y = max(X,Y),min(X,Y) if Z < X - Y: print(Z + Y + Z) else: val = (X+Y+Z)//2 print(val)