s = input() p = list(map(int, [s[0], s[1], s[2]])) print(max(p) - min(p))