X, Y, Z = map(int, input().split()) A = min(X, Y) B = max(X, Y) C = min(Z, B - A) print(A + C + (Z - C) // 2)