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