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