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