#include <bits/stdc++.h>
int a[100006];
using namespace std;
int main() {
  int d = 0, n = 0;
  cin >> d >> n;
  int i = 0, ans = 0;
  for (; i < n; i++) {
    cin >> a[i];
    if (i != n - 1) ans += (d - a[i]);
  }
  cout << ans;
  return 0;
}
