import static java.util.Arrays.deepToString;

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

public class elections_nn {

	static final int MAXN = 300000;
	static final int MAXK = 100000;

	static void solve() throws Exception {
		int n = nextInt();
		int k = nextInt();
		assert 1 <= n && n <= MAXN;
		assert 1 <= k && k <= MAXK;
		boolean[] has = new boolean[n + 1];
		for (int i = 0; i < k; i++) {
			int x = nextInt();
			assert 2 <= x && x <= n;
			has[x] = true;
		}
		boolean[] was = new boolean[n + 1];
		for (int i = 2; i <= n; i++) {
			if (!has[i]) {
				continue;
			}
			for (int j = i; j <= n; j += i) {
				was[j] = true;
			}
		}
		int ans = 0;
		for (int i = 1; i <= n; i++) {
			if (!was[i]) {
				ans++;
			}
		}
		out.println(ans);
	}


	static BufferedReader br;
	static StringTokenizer st;
	static PrintWriter out;

	static void debug(Object... a) {
		System.err.println(deepToString(a));
	}

	static int nextInt() throws IOException {
		return Integer.parseInt(next());
	}

	static String next() throws IOException {
		while (st == null || !st.hasMoreTokens()) {
			String line = br.readLine();
			if (line == null) {
				return null;
			}
			st = new StringTokenizer(line);
		}
		return st.nextToken();
	}

	static long nextLong() throws IOException {
		return Long.parseLong(next());
	}

	static double nextDouble() throws IOException {
		return Double.parseDouble(next());
	}

	public static void main(String[] args) {
		try {
			File file = new File("elections.in");
			InputStream input = System.in;
			OutputStream output = System.out;
			if (file.canRead()) {
				input = (new FileInputStream(file));
				output = (new PrintStream("elections.out"));
			}
			br = new BufferedReader(new InputStreamReader(input));
			out = new PrintWriter(output);
			solve();
			out.close();
			br.close();
		} catch (Throwable e) {
			e.printStackTrace();
			System.exit(1);
		}
	}
}
