#include <bits/stdc++.h>
int main() {
  int d;
  while (~scanf("%d", &d)) {
    int n;
    scanf("%d", &n);
    int i;
    int res = 0, num;
    for (i = 0; i < n - 1; ++i) {
      scanf("%d", &num);
      res += d - num;
    }
    scanf("%*d");
    printf("%d\n", res);
  }
  return 0;
}
