#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  int opx, t, c;
  cin >> t >> c;
  int dfx = 1;
  long long lorenzo = 0;
  while (c--) {
    cin >> opx;
    if (dfx != 1) lorenzo += t - dfx + 1;
    dfx = opx + 1;
  }
  cout << lorenzo;
}
