A, B, C = map(int, input().split()) if not (A != B != C and sorted([A, B, C])[1] 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)