puts !(s=gets.delete("^1-9")).empty?() ? s.chars.to_a.map(&:to_i).inject{|sum,i| sum += i} : 0