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