#include <bits/stdc++.h>
using namespace std;
const int M = 1000000007;
const int N = 1e5 + 1;
double PI = 2 * acos(0.0);
vector<int> isprime(N, true);
vector<int> prime;
vector<int> spf(N);
void seive() {
  isprime[0] = isprime[1] = false;
  for (int i = 2; i < N; i++) {
    if (isprime[i]) {
      prime.push_back(i);
      spf[i] = i;
    }
    for (int j = 0;
         j < (int)prime.size() && i * prime[j] < N && prime[j] <= spf[i]; j++) {
      isprime[i * prime[j]] = false;
      spf[i * prime[j]] = prime[j];
    }
  }
}
vector<int> getPrimeFacts(int x) {
  vector<int> ret;
  while (x != 1) {
    ret.push_back(spf[x]);
    x = x / spf[x];
  }
  return ret;
}
int fast_pow(int a, int p) {
  int res = 1;
  while (p) {
    if (p % 2 == 0) {
      a = a * 1ll * a % M;
      p /= 2;
    } else {
      res = res * 1ll * a % M;
      p--;
    }
  }
  return res;
}
int fact(int n) {
  int res = 1;
  for (int i = 1; i <= n; i++) {
    res = res * 1ll * i % M;
  }
  return res;
}
int ncr(int n, int k) {
  return fact(n) * 1ll * fast_pow(fact(k), M - 2) % M * 1ll *
         fast_pow(fact(n - k), M - 2) % M;
}
bool isPowerOfTwo(int n) {
  if (n == 0) return false;
  return (ceil(log2(n)) == floor(log2(n)));
}
int strtoint(string s) {
  stringstream geek(s);
  int x = 0;
  geek >> x;
  return x;
}
void getVec(vector<int>& v, int n) {
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    v.push_back(a);
  }
}
int ask(int l, int r) {
  if (l >= r) return -1;
  cout << "? " << l + 1 << ' ' << r + 1 << endl;
  int ans;
  cin >> ans;
  return ans - 1;
}
void solve() {
  int d;
  cin >> d;
  int n;
  cin >> n;
  vector<int> a;
  getVec(a, n);
  int ans = 0;
  for (int i = 1; i < n; i++) ans += (d - a[i - 1]);
  cout << ans;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) solve();
}
