#include <bits/stdc++.h>
using namespace std;
int n, p[2222], d;
int main() {
  int i, ans = 0;
  cin >> d;
  cin >> n;
  for (i = 0; i < n - 1; i++) {
    cin >> p[i];
    if (p[i] != d) ans += (d - p[i]);
  }
  cout << ans << endl;
}
