r,b,w = map(int, input().split()) p = max(r,b) w -= abs(r-b) p += w//2 print(p)