#include #include #include using namespace std; int main() { int n; cin >> n; vector a(n); for (int i = 0; i < n; ++i) { cin >> a[i]; } int v; cin >> v; int sum = accumulate(a.begin(), a.end(), 0); cout << (sum - v) << endl; return 0; }