#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <typename T>
inline T lcm(T a, T b) {
  if (a < 0) return lcm(-a, b);
  if (b < 0) return lcm(a, -b);
  return a * (b / gcd(a, b));
}
template <typename T>
inline T dis(T x1, T y1, T x2, T y2) {
  return sqrt(sqr(x1 - x2) + sqr(y1 - y2));
}
template <class T>
inline bool odd(T x) {
  return x & 1;
}
template <class T>
inline bool even(T x) {
  return !odd(x);
}
void solve() {
  long long n;
  long long d;
  cin >> d >> n;
  long long tmp;
  long long res = 0;
  for (long long i = 0; i < n; i++) {
    cin >> tmp;
    if (d > tmp && i != n - 1) res += (d - tmp);
  }
  cout << res;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long T;
  T = 1;
  while (T--) solve();
  return 0;
}
