def main(): N = int(input()) K = int(input()) ilist = [int(input()) for _ in range(K)] nb = 0 lights = [True for _ in range(N+1)] for j in range(K): l = 1 i = ilist[j] while i*l <= N: lights[i*l] = not lights[i*l] l+=1 nb = max(nb, len([0 for a in lights if not a])) print(nb) main()