#include #include #include using namespace std; #define RREP(i,s,e) for (i = s; i >= e; i--) #define rrep(i,n) RREP(i,(int)(n)-1,0) #define REP(i,s,e) for (i = s; i <= e; i++) #define rep(i,n) REP(i,0,(int)(n)-1) #define INF 100000000 typedef long long ll; int main() { int i, n, sum, v; cin >> n; sum = 0; rep (i,n) { int a; cin >> a; sum += a; } cin >> v; cout << sum - v << endl; return 0; }