while s = gets
digits = s[0] == '-' ? [-s[1].to_i] + s[2..-1].each_char.to_a : s.each_char
puts s.to_i + s.strip.size + digits.map(&:to_i).inject(&:+)
end
d2hpbGUgcyA9IGdldHMKCWRpZ2l0cyA9IHNbMF0gPT0gJy0nID8gWy1zWzFdLnRvX2ldICsgc1syLi4tMV0uZWFjaF9jaGFyLnRvX2EgOiBzLmVhY2hfY2hhcgoJcHV0cyBzLnRvX2kgKyBzLnN0cmlwLnNpemUgKyBkaWdpdHMubWFwKCY6dG9faSkuaW5qZWN0KCY6KykKZW5k