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