#include <bits/stdc++.h>
using namespace std;
int main() {
  int D;
  int N;
  int sum = 0;
  int DAYS[2001];
  scanf("%d", &D);
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    scanf("%d", &DAYS[i]);
    if (i + 1 < N) sum += D - DAYS[i];
  }
  printf("%d\n", sum);
  return 0;
}
