#include <iostream>
#include <fstream>
#include <queue>
#include <set>
#include <assert.h>

using namespace std;

struct num
{
	int val, mult;
	num(int val, int mult = 1) : val(val), mult(mult) {}
	bool operator<(const num& n) const
	{	return val * mult > n.val * n.mult;}
	int get() const
	{	return val * mult;}
};

int main()
{
	ifstream in("elections.in");
	ofstream out("elections.out");
	int n, k;
	in >> n >> k;
	assert (1 <= n && n <= 300000);
	assert (1 <= k && k <= 100000);
	set<int> s;
	for (int i = 0; i < k; i++)
	{
		int a;
		in >> a;
		assert (2 <= a && a <= n);
		s.insert(a);
	}

	priority_queue<num> q;
	for (set<int>::const_iterator it = s.begin(); it != s.end(); it++)
		q.push(num(*it));

	int last = 0;
	int cnt = 0;
	while (q.top().get() <= n)
	{
		num now = q.top();
		q.push(num(now.val, now.mult + 1));
		q.pop();
		int current_val = now.get();
		while (last + 1 < current_val)
		{
			last++;
			cnt++;	
//			cerr << last << " ";
		}
		last = current_val;
	}
//	cerr << "\n";
	cnt += n - last;
//	cerr << cnt << " " << last << "!\n";
	out << cnt << "\n";
}