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