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