#include <bits/stdc++.h>
using namespace std;
const long long oo = 1e9;
const long long oo64 = 1e18;
const long long MAXSIZE = oo + 7;
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  srand(time(NULL));
  ;
  long long d;
  cin >> d;
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long ans = 0;
  for (long long i = 0; i < n - 1; i++) {
    if (a[i] < d) {
      ans += (d - a[i]);
    }
  }
  cout << ans;
  return 0;
}
