a = gets.chomp b = a.delete("^0-9") c = b.chars d = c.map(&:to_i) p d.inject(:+)