abc = gets.split("").map(&:to_i) abc.pop() puts abc.max - abc.min