#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
const int oo = 0x3f3f3f3f;
const long long ooLL = 0x3f3f3f3f3f3f3f3fLL;
int main() {
  int d, n;
  scanf("%d%d", &d, &n);
  int sol = 0;
  for (int i = 1; i < n; ++i) {
    int x;
    scanf("%d", &x);
    sol += d - x;
  }
  printf("%d\n", sol);
  return 0;
}
