#include using namespace std; int N; int A[1000]; int v; int main() { cin >> N; int sum = 0; for( int i = 0; i < N; i++ ) { cin >> A[i]; sum += A[i]; } cin >> v; cout << sum - v << endl; return 0; }