n = gets.chomp tot = 1 qq = [3,2,2,2,3,2,3,2,4,3] for c in n.split('') tot += qq[c.ord - 48] end puts tot