Minho's number game

Count integers from 1 to N divisible by at least one of up to 20 given numbers, where duplicates and multiples make plain unions invalid.

Medium7CombinatoricsNumber theoryMathBit manipulationNo attempts yetTime limit2sMemory limit512 MB

Problem

Minho has KK cards. Each card has one positive integer written on it. Minho made up a number game with them.

The game is to count how many positive integers from 1 to NN are divisible by at least one of the numbers written on the cards.

There are far too many numbers to count by hand. Count them for Minho.

Input

The first line contains NN and KK, separated by a space. (1N1091 \le N \le 10^9, 1K201 \le K \le 20)

The second line contains the numbers written on the cards, A1,A2,,AKA_1, A_2, \dots, A_K, in order and separated by spaces. (1Ai1091 \le A_i \le 10^9)

Several cards may carry the same number.

Output

Print on one line how many positive integers from 1 to NN are divisible by at least one of the numbers written on the cards.