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