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