#include using namespace std; int main() { int n, sum = 0, k; cin >> n; for (int i = 0; i < n; i++) { int e; cin >> e; sum += e; } cin >> k; cout << sum - k << '\n'; return 0; }