#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:200000000")
using namespace std;
const int INF = (int)1e9;
const long long INF64 = (long long)1e18;
const long double eps = 1e-9;
const long double pi = 3.14159265358979323846;
int main() {
  long long n, d;
  cin >> d >> n;
  vector<long long> a(n);
  for (int i = 0; i < int(n); ++i) cin >> a[i];
  long long ans = 0;
  for (int i = 0; i < n - 1; i++) ans += d - a[i];
  cout << ans;
  return 0;
}
