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

int main() {
  int N, M;
  cin >> N >> M;
  vector<int> vec(M);

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

}
