x, y, z = map(int, input().split()) ans = 0 pair = min(x, y) ans += pair if z < abs(x-y): ans += z z = 0 m = min(abs(x-y), z) ans += m ans += max(0, (z-m))//2 print(ans)