#include <bits/stdc++.h>
const int MOD = 1e9 + 7;
using namespace std;
signed main() {
  long long t, n;
  cin >> t >> n;
  long long a[n];
  set<long long> s;
  long long c = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n - 1; i++) {
    c += t - a[i];
  }
  cout << c << endl;
  return 0;
}
