#include <bits/stdc++.h>
int main() {
  int d, n;
  scanf("%i%i", &d, &n);
  int* mon = new int[n];
  for (int i = 0; i < n; i++) scanf("%i", &mon[i]);
  int inc = 0;
  for (int i = 0; i < n - 1; i++) {
    inc += d - mon[i];
  }
  printf("%i\n", inc);
  return 0;
}
