#include <bits/stdc++.h>
int main() {
  int no, months, need = 0, i;
  scanf("%d", &no);
  scanf("%d", &months);
  int array1[months];
  for (i = 0; i < months; i++) {
    scanf("%d", &array1[i]);
    if (array1[i] < no && i != (months - 1)) need += (no - array1[i]);
  }
  printf("%d", need);
  return 0;
}
