X, Y, Z = map(int, input().split()) diff = abs(X - Y) if diff > Z: ans = min(X, Y) else: ans = max(X, Y) Z -= diff ans += Z // 2 print(ans)