import java.io.*;
import java.util.*;

public class elections_pk {
	public static void main(String[] args) {
		new elections_pk().run();
	}

	BufferedReader br;
	StringTokenizer in;
	PrintWriter out;

	public String nextToken() throws IOException {
		while (in == null || !in.hasMoreTokens()) {
			in = new StringTokenizer(br.readLine());
		}
		return in.nextToken();
	}

	public int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	public long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	public double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	class Divisor implements Comparable<Divisor> {
		int a, k;

		public int a() {
			return a * k;
		}

		public Divisor(int a, int k) {
			super();
			this.a = a;
			this.k = k;
		}

		@Override
		public int compareTo(Divisor t) {
			if (a() != t.a())
				return a() - t.a();
			else
				return k - t.k;
		}
	}

	public void solve() throws IOException {
		int n = nextInt();
		int k = nextInt();
		TreeSet<Divisor> a = new TreeSet<Divisor>();
		for (int i = 0; i < k; i++) {
			a.add(new Divisor(nextInt(), 1));
		}
		int cnt = n;
		for (int i = 1; i <= n; i++) {
			if (a.first().a() == i)
				cnt--;
			while (a.first().a() == i) {
				Divisor z = a.first();
				a.remove(a.first());
				z.k++;
				a.add(z);
			}
		}
		out.println(cnt);
	}

	public void run() {
		try {
			br = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);
			br = new BufferedReader(new FileReader("elections.in"));
			out = new PrintWriter("elections.out");

			solve();

			out.close();
		} catch (IOException e) {
			e.printStackTrace();
			System.exit(1);
		}
	}
}