#include <bits/stdc++.h>
using namespace std;
const int maxint = 0x7fffffff;
const int minint = 0x80000000;
const double eps = 1e-6;
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int max(int a, int b) { return a > b ? a : b; }
int main() {
  int sum, d, n, a;
  scanf("%d", &d);
  scanf("%d", &n);
  sum = 0;
  while (--n) {
    scanf("%d", &a);
    sum += d - a;
  }
  scanf("%d", &a);
  printf("%d\n", sum);
  return 0;
}
