#include <bits/stdc++.h>
using namespace std;
int main() {
  int total, n;
  cin >> total >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  int ans = 0;
  for (int i = 0; i < n - 1; i++) {
    ans += (total - v[i]);
  }
  cout << ans;
}
