import sys if sys.platform == 'ios': sys.stdin = open('in.txt') sys.setrecursionlimit(10**6) a, b, c = map(int, input().split()) ans = min(b - a, b - c, abs(a - c)) print(ans)