input_line = gets.chomp input_arr = input_line.split('') i = 1 input_arr.each do | n | i = i + 1 end answer = i * 9 puts answer