N = gets.to_i A = gets B = A.split(" ").map(&:to_i) v = gets.to_i ans = B.inject(:+) - v puts ans