#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:64000000")
using std::cerr;
using std::cin;
using std::cos;
using std::cout;
using std::endl;
using std::make_pair;
using std::max;
using std::min;
using std::next_permutation;
using std::pair;
using std::priority_queue;
using std::queue;
using std::random_shuffle;
using std::set;
using std::sin;
using std::sort;
using std::sqrt;
using std::stack;
using std::string;
using std::stringstream;
using std::swap;
using std::vector;
const long double PI = 3.14159265358979323846;
int main() {
  int d, n, x;
  cin >> d >> n;
  x = d;
  int res = 0;
  for (int i = 0; i < n; ++i) {
    res += d - x;
    cin >> x;
  }
  cout << res << endl;
  return 0;
}
