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