inputs = gets sum = 0 inputs.each_char do |c| if c.match(/\d/) sum += c.to_i end end puts sum