A, B, C = map(int, input().split()) def solve(A, B, C): if A == B or B == C or C == A or sorted([A, B, C])[1] not in [A, C]: print(0) elif B == max([A, B, C]): print(B - max(A, C)) elif B == min([A, B, C]): print(min(A, C) - B) else: print(0) solve(A, B, C)