#include using namespace std; int main(void) { int n, a, v; cin >> n; int sum = 0; for (int i = 0; i < n; ++i) { cin >> a; sum += a; } cin >> v; cout << sum - v << endl; return 0; }