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