A, B, C = map(int, input().split()) if B == max([A, B, C]): print(B - max(A, C)) else: print(0)