EPS/29-01-24/lights.py
2024-01-30 15:04:05 +01:00

20 lines
372 B
Python

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()