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