s = input() a = [int(s[i]) for i in range(3)] a.sort() ans = a[2] - a[0] print("{}".format(ans))