// macros
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <map>

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;

#define LLINF 1000000000000000000LL
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define debug(a) cout << "L(" << __LINE__ << "):" << #a << ":" << a << endl;

// problems limits
#define MAX_N 10000

// Variables
int N,v;
int A[MAX_N];

// problems input
void input()
{
    cin >> N;
    FOR(i,0,N) cin >> A[i];
    cin >> v;
}

// problems main
void solve()
{
    int sum=0;
    FOR(i,0,N) {
        sum += A[i];
    }
    cout << sum - v << endl;
}

int main()
{
    ios::sync_with_stdio(false);

    input();

    solve();
}