abc = input() a = abc[0] b = abc[1] c = abc[2] MAX = max(list(map(int, [a, b, c]))) MIN = min(list(map(int, [a, b, c]))) print(MAX - MIN)