def scan; gets.split.map(&:to_i); end line = gets.chomp n = line.size s={} (0..9).each{|e|s[e.to_s]=0} line.chars{|c| s[c]+=1 } cnt = 0 cnt += n cnt += 1 cnt += s["0"]+s["4"]+s["6"]+s["8"]*2+s["9"] cnt += n p cnt