A, B, S = map(int, input().split()) print(abs(A - S) + S)