N = gets.to_i A = gets.to_s x = A.split(/\r?\n/).map(&:to_i) puts x.sum