Yunho the Potion Thief

Each bought potion yields at most one divisor, and divisors chosen across potions must share no prime factor; maximize how many such divisors can be extracted.

Hard8Number theoryDynamic programmingBit manipulationBrute forceNo attempts yetTime limit1sMemory limit512 MB

Problem

Hyobin's magic factory sells potions carrying product numbers from 2 to NN. Yunho bought MM of them and decided to open a potion shop. Yeongseon, Yunho's informant, told him Hyobin's secret. If a product AA was made by mixing potions with product numbers P1,P2,,PkP_1, P_2, \dots, P_k, then the product number of AA is P1×P2××PkP_1 \times P_2 \times \cdots \times P_k, and there is no exception. Those P1,P2,,PkP_1, P_2, \dots, P_k are the ingredients of AA. Hyobin noticed all this and cut Yunho off. What Yunho still has is the MM potions he bought and the magic machine his father left him.

The machine decomposes a potion AA and pulls out one potion that can be an ingredient of AA, that is, one potion whose product number divides the product number of AA and is at least 2. The decomposed potion AA is destroyed. For example, decomposing potion 12 yields one of potions 2, 3, 4, 6 and 12. Yunho wants potions whose effects do not overlap, so the extracted potions must not share an ingredient. Suppose Yunho decomposes qq potions and pulls out potions with product numbers Y1,Y2,,YqY_1, Y_2, \dots, Y_q. If some potion KK can be an ingredient of YiY_i and can also be an ingredient of YjY_j for iji \neq j, the extraction fails. For example, say Yunho bought potions 12 and 18. Decomposing 12 into potion 4 and 18 into potion 6 fails, because potion 2 can be an ingredient of both. Pulling out 4 and 9 succeeds, because no potion number can be an ingredient of both. Find the largest number of potions Yunho can pull out without failing.

Input

The first line contains NN and MM. (2N1000000002 \le N \le 100\,000\,000, 1M10001 \le M \le 1\,000)

The second line contains MM integers, the product numbers of the potions Yunho bought from Hyobin. Each number is at least 2 and at most NN.

Output

Print on one line the largest number of potions Yunho can pull out without failing.