#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
#pragma GCC optimize("Ofast")
using namespace std;
void fastio() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
long long dp[101][1001], ans1 = 1e9, dp1[1000001];
long long num[10];
long long a[1000000];
signed main() {
  fastio();
  long long t = 1, x1 = 1;
  while (t--) {
    long long n, d;
    cin >> d >> n;
    long long a[n];
    set<long long> s;
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
      s.insert(a[i]);
    }
    long long sum = 0;
    for (long long i = 0; i < n - 1; i++) sum += d - a[i];
    cout << sum;
  }
}
