#include <bits/stdc++.h>
int main() {
  unsigned int d = 0, n = 0;
  scanf("%d%d", &d, &n);
  unsigned int ans = 0, v = 0;
  for (unsigned int i = 0; i < n; ++i) {
    scanf("%d", &v);
    if (i + 1 != n) ans += (d - v);
  }
  printf("%u\n", ans);
  return 0;
}
