n = gets.chomp.to_i as = [] n.times {|i| a = gets.chomp.to_i as << a } p as.sum