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