#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const double eps = 1.0e-10;
int main() {
  int d, n, x, c = 0;
  scanf("%d%d", &d, &n);
  while (n--) {
    scanf("%d", &x);
    if (n > 0) c += d - x;
  }
  printf("%d\n", c);
}
