#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, d, n, sum;
  int a;
  while (cin >> d) {
    sum = 0;
    cin >> n;
    for (i = 0; i < n - 1; i++) {
      cin >> a;
      sum += d - a;
    }
    cout << sum << endl;
    cin >> d;
  }
  return 0;
}
