You have written on a piece of paper an array of *n* positive integers *a*[1], *a*[2], ..., *a*[*n*] and *m* good pairs of integers (*i*<sub class="lower-index">1</sub>, *j*<sub class="lower-index">1</sub>), (*i*<sub class="lower-index">2</sub>, *j*<sub class="lower-index">2</sub>), ..., (*i*<sub class="lower-index">*m*</sub>, *j*<sub class="lower-index">*m*</sub>). Each good pair (*i*<sub class="lower-index">*k*</sub>, *j*<sub class="lower-index">*k*</sub>) meets the following conditions: *i*<sub class="lower-index">*k*</sub> + *j*<sub class="lower-index">*k*</sub> is an odd number and 1 ≤ *i*<sub class="lower-index">*k*</sub> &lt; *j*<sub class="lower-index">*k*</sub> ≤ *n*.

In one operation you can perform a sequence of actions: 
 -  take one of the good pairs (*i*<sub class="lower-index">*k*</sub>, *j*<sub class="lower-index">*k*</sub>) and some integer *v* (*v* &gt; 1), which divides both numbers *a*[*i*<sub class="lower-index">*k*</sub>] and *a*[*j*<sub class="lower-index">*k*</sub>]; -  divide both numbers by *v*, i. e. perform the assignments: <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/192b5056ddf57cd3030615790d2a21051c01bc9d.png" style="max-width: 100.0%;max-height: 100.0%;"/> and <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/f143c28d601c34862d9b5035284c5bde440a0e3d.png" style="max-width: 100.0%;max-height: 100.0%;"/>. 
Determine the maximum number of operations you can sequentially perform on the given array. Note that one pair may be used several times in the described operations.
The first line contains two space-separated integers *n*, *m* (2 ≤ *n* ≤ 100, 1 ≤ *m* ≤ 100).

The second line contains *n* space-separated integers *a*[1], *a*[2], ..., *a*[*n*] (1 ≤ *a*[*i*] ≤ 10<sup class="upper-index">9</sup>) — the description of the array.

The following *m* lines contain the description of good pairs. The *k*-th line contains two space-separated integers *i*<sub class="lower-index">*k*</sub>, *j*<sub class="lower-index">*k*</sub> (1 ≤ *i*<sub class="lower-index">*k*</sub> &lt; *j*<sub class="lower-index">*k*</sub> ≤ *n*, *i*<sub class="lower-index">*k*</sub> + *j*<sub class="lower-index">*k*</sub> is an odd number).

It is guaranteed that all the good pairs are distinct.
L,m=[int(e) for e in input().split()]
def pdd(x):
    d={}
    i=2
    while i*i<=x:
        if x%i==0:
            d[i]=1
            x//=i
            while x%i==0:
                x//=i
                d[i]+=1
        i+=1
    if x!=1:
        d[x]=1
    return d
D=[pdd(int(e)) for e in input().split()]
a=[]
mt=[]
I={}
J={}
for _ in range(m):
    i,j=[int(e)-1 for e in input().split()]
    if i%2>j%2:
        i,j=j,i
    for key in D[i].keys():
        if key in D[j]:
            for vali in range(D[i][key]):
                for valj in range(D[j][key]):
                    t0=(i,key,vali)
                    t1=(j,key,valj)
                    ti=None
                    tj=None
                    if t0 not in I.keys():
                        ti=len(a)
                        a.append([])
                        I[t0]=ti
                    else:
                        ti=I[t0]
                    if t1 not in J.keys():
                        tj=len(mt)
                        mt.append(-1)
                        J[t1]=tj
                    else:
                        tj=J[t1]
                    a[ti].append(tj)
n=len(a)
k=len(mt)
u=[0]*n
def kun(x):
    if u[x]:
        return 0
    u[x]=1
    for y in a[x]:
        if mt[y]==-1 or kun(mt[y]):
            mt[y]=x
            return 1
    return 0
for i in range(n):
    u=[0]*n
    kun(i)
print(sum(x!=-1 for x in mt))