#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, c = 0, d = 0, x;
  cin >> x;
  cin >> n;
  long long int a[n];
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (long long int i = 0; i < n - 1; i++) {
    c += a[i];
  }
  cout << (x * (n - 1)) - c << endl;
}
