#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200008;
const long long inf = 1000000001;
const long long INF = 2e18;
const long double EPS = 1e-7;
const long long mod = inf + 6;
const int moff = 998244353;
const int mod13 = 1000003;
const long double PI = acos(-1.0);
signed main() {
  ios_base::sync_with_stdio(0);
  cout.tie(0);
  cin.tie(0);
  ;
  int d, n;
  cin >> d >> n;
  vector<int> a(n);
  for (long long i = 0; i < a.size(); ++i) cin >> a[i];
  ;
  int ans = 0;
  for (int i = 0; i < n - 1; ++i) {
    ans += d - a[i];
  }
  cout << ans;
}
