#include <algorithm>
#include <iostream>
#include <cmath>
#include <cstdlib>
#include <numeric>
#include <string>
#include <vector>

using namespace std;

int main() {
  int n;
  cin >> n;
  int m;
  cin >> m;

  vector<int> A(m);

  for (int i = 0; i < m; i++) {
    int a;
    cin >> a;
    A[i] = a;
  }

  int sum = accumulate(A.begin(), A.end(), 0);
  
  cout << (n - sum) << endl;
  return 0;
}
