#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long d, n;
  cin >> d >> n;
  long long arr[n];
  for (long long i = 0; i < (n); i++) {
    cin >> arr[i];
  }
  long long count = 0;
  for (long long i = 0; i < (n - 1); i++) {
    count += (d - arr[i]);
  }
  cout << count << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int t = 1;
  while (t--) solve();
  return 0;
}
