#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T RD(T &a) {
  T x;
  cin >> x;
  return a = x;
}
const float pi = acos(-1);
signed main() {
  ios_base::sync_with_stdio(NULL);
  cin.tie(0);
  cout.tie(0);
  int n, c;
  cin >> n >> c;
  int cnt = 0, t;
  for (int i = 0; i < c; i++) {
    cnt += RD(t);
  }
  cout << max(n - cnt, 0);
}
