#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int d;
  cin >> d;
  int n;
  cin >> n;
  int cnt = 0, tmp;
  for (long long int i = 0; i < n - 1; i++) {
    cin >> tmp;
    cnt += (d - tmp);
  }
  cin >> tmp;
  cout << cnt;
  return 0;
}
