import static java.util.Arrays.deepToString;

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

public class elections_nn_slow {

	static void solve() throws Exception {
		int n = nextInt();
		int k = nextInt();
		int[] a = new int[k];
		for (int i = 0; i < k; i++) {
			a[i] = nextInt();
		}
		int ans = 0;
		for (int i = 1; i <= n; i++) {
			boolean ok = true;
			for (int j = 0; j < k; j++) {
				if (i % a[j] == 0) {
					ok = false;
					break;
				}
			}
			if (ok) {
				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);
		}
	}
}
