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