#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  int sum = 0, temp;
  while (m--) {
    cin >> temp;
    sum += temp;
  }
  cout << n - sum << "\n";
  return 0;
}
