#include <bits/stdc++.h>
using namespace std;
int main() {
  int d;
  int n;
  int cnt = 0;
  cin >> d;
  cin >> n;
  int a;
  for (int i = 0; i < n; i++) {
    cin >> a;
    cnt += d - a;
  }
  cnt -= d - a;
  cout << cnt;
  return 0;
}
