#include <bits/stdc++.h>
using namespace std;
int ara[2000 + 6];
int main() {
  int d;
  scanf("%d", &d);
  int n;
  scanf("%d", &n);
  for (int i = 0; i <= n - 1; i++) scanf("%d", &ara[i]);
  int cnt = 0;
  int now = 0;
  for (int i = 0; i < n - 1; i++) {
    cnt += (d - ara[i]);
  }
  cout << cnt << endl;
  return 0;
}
