#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long k, n, arr[2000];
  cin >> k >> n;
  for (long long i = 0; i < n; i++) cin >> arr[i];
  long long ans = 0;
  for (long long i = 1; i < n; i++) ans += k - arr[i - 1];
  cout << ans << '\n';
  return 0;
}
