#include <bits/stdc++.h>
using namespace std;
int main() {
  long long d;
  cin >> d;
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long s = 0;
  for (long long i = 0; i < n - 1; i++) {
    if (d > a[i]) s += (d - a[i]);
  }
  cout << s;
  return 0;
}
