n=gets.to_i as=gets.chomp.split.map(&:to_i) v=gets.to_i s=as.inject(:+) p (s-v) # 差 (.abs とは言ってない)