#include #include using namespace std; long long N, A[1000], v; void solve() { scanf("%ld", &N); for (int i = 0; i < N; i++) scanf("%ld", &A[i]); scanf("%ld", &v); long long s = 0; for (int i = 0; i < N; i++) s += A[i]; printf("%ld\n", s - v); } int main() { solve(); return 0; }