#include <bits/stdc++.h>
using namespace std;
const int OO = (int)1e6;
const double EPS = (1e-11);
int dcmp(double x, double y) { return fabs(x - y) <= EPS ? 0 : x < y ? -1 : 1; }
int main() {
  int d;
  int n;
  cin >> d >> n;
  int x;
  int ans = 0;
  for (int i = 0; i < (int)(n - 1); ++i) {
    cin >> x;
    ans += (d - x);
  }
  cout << ans;
  return 0;
}
