#include <iostream>
using namespace std;

int main() {
	int n,a=0,v;cin>>n;for(int i=0;i<n;i++){cin>>v;a+=v;}cin>>v;cout<<a-v<<endl;
	return 0;
}