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