r,b,w = map(int, input().split()) w -= abs(r-b) p = max(r,b) + w//2 if w<0 and w%2==1: p -= 1 print(p)