#include <bits/stdc++.h>
using namespace std;
void solve() {
  int d, n;
  cin >> d >> n;
  vector<int> v;
  for (int i = 0; i < n; i++) {
    int c;
    cin >> c;
    v.push_back(c);
  }
  int reset = 0;
  for (int i = 0; i < n - 1; i++) {
    reset += d - v[i];
  }
  cout << reset;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  solve();
}
