#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
struct Union {
  vector<ll> par;
  Union(ll a) { par = vector<ll>(a, -1); }
  ll find(ll a) {
    if (par[a] < 0) {
      return a;
    } else {
      return par[a] = find(par[a]);
    }
  }
  bool same(ll a, ll b) { return (find(a) == find(b)); }
  ll size(ll a) { return -par[find(a)]; }
  void unite(ll a, ll b) {
    ll c = find(a), d = find(b);
    if (c == d) return;
    if (size(c) < size(d)) {
      swap(c, d);
    }
    par[c] += par[d];
    par[d] = c;
  }
};
int main() {
  ll n, m, b = 0;
  cin >> n >> m;
  ll a[m];
  for (ll i = 0; i < m; ++i) {
    cin >> a[i];
    b += a[i];
  }
  if (n - b < -1) b = n + 1;
  cout << n - b;
}
