#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100001;
const int INF = 0x7FFFFFFF;
const double eps = 1e-10;
const double pi = acos(-1.0);
int n, d;
int a[MAXN];
void init() {
  cin >> d;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
}
void solve() {
  long long ret = 0;
  for (int i = 0; i < n - 1; i++) {
    ret += d - a[i];
  }
  cout << ret << endl;
}
int main() {
  ios::sync_with_stdio(0);
  init();
  solve();
  return 0;
}
