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