puts (gets.split.map(&:to_i)).inject(0){|s,i| if i % 15 == 0 s += 8 elsif i % 3 == 0 || i % 5 == 0 s += 4 else s += i.to_s.length end }