#include<bits/stdc++.h>
using namespace std;
const double pi = acos(-1);

int32_t main () {
	int n, m; cin >> n >> m;
	vector<int> arr(m, 0);
	for(int i = 0; i < m; i ++) cin >> arr[i];
	int sum = accumulate(arr.begin(), arr.end(), 0);
	cout << n - sum << endl;
	return 0;
}