s = gets.chars.map(&:to_i) puts s.inject {|sum, i| sum + i}