a, b, c = map(int, input().split()) if a > c: a, c = c, a if a < b and c < b: ans = min(b - c, c - a) else: ans = min(a - b, c - a) print(ans)