gets $I = 0 puts gets.chars.reverse.each_with_index.map {|c, i| c == ?0 ? ($I = i + 1) : $I }.sum