Problem: Max feels lonely after shifting to a new locality, as he does not have any friend there. So his parents bought him a new number from the Integers SuperMarket! Every child in the locality has bought a number from the same market.  

He takes the number to go play with other children in the locality. But to his surprise, there is a rule in the locality, two people A and B can only be considered friends if numbers with A and B are not Coprime, i.e they have a common factor other than 1.  

You are given the number that Max bought and the numbers of other children in the locality. Can you find how many friends he can have?   

Input:
First line contains an integer A, the number that Max has.
Second line contains N, the count of children in the locality.
Third line contains N space-separated integers, where  Xi is the integer with the i^th child.  

Output:
Output the maximum number of friends that Max can make.  

Constraints:
1 ≤ A ≤ 10^3
1 ≤ N ≤ 10^3
1 ≤ Xi  ≤ 10^3

SAMPLE INPUT
6
3
4 7 12

SAMPLE OUTPUT
2

Explanation

Puchi can become friends with First and Third child.

Solution (in PYTHON):

Solution:
'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
m = int(raw_input().strip())
_ = raw_input()


ll = raw_input().strip()

mm = []

ll = ll.split(' ')
# print ll

for l1 in ll:
    mm.append(int(l1.strip()))


def f(j, k):
    tmp = j % k
    if tmp == 0:
        return k
    else:
        return f(k, tmp)

count = 0
for m1 in mm:
    if m > m1:
        mt1 = m
        mt2 = m1
    else:
        mt1 = m1
        mt2 = m
    tmp = f(mt1, mt2)
#     print mt1, mt2, tmp
    if tmp > 1:
        count += 1

print count