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