number = input() print(max(number) - min(number))