A, B, C = map(int, input().split()) if A > C: A, C = C, A if B > C: print(min(B - C, C - A)) elif A > B: print(min(A - B, C - A)) else: print(0)