#include <bits/stdc++.h>
using namespace std;

int main() {
  int N, M;
  cin >> N >> M;
  int answer = 0;
  vector<int> A(M);

  for (int i = 0; i < M; i++) {
    cin >> A.at(i);
    answer+= A.at(i);
  }
  
  cout << N - answer << endl;
  
}
