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