#include <bits/stdc++.h>
using namespace std;
bool secdes(const pair<long long, long long>& a,
            const pair<long long, long long>& b) {
  if (a.second == b.second) {
    return a.first > b.first;
  } else {
    return a.second > b.second;
  }
}
bool sir(const pair<long long, long long>& a,
         const pair<long long, long long>& b) {
  if (a.first == b.first) {
    return a.second > b.second;
  } else {
    return a.first > b.first;
  }
}
const long long no = 3e5 + 5;
long long a[no], b[no];
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, d;
  cin >> d;
  cin >> n;
  for (long long i = 1; i <= n; i++) cin >> a[i];
  long long sum = 0;
  for (long long i = 2; i <= n; i++) sum += (d - a[i - 1]);
  cout << sum;
}
