A, B = map(int, input().split())
from fractions import gcd
g = gcd(A,B)

#素因数分解して列挙する関数、約数列挙ではない！
def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    fct = list(set(fct))
    return fct

f = factorize(g)
ans = len(f)+1
print(ans) A, B = map(int, input().split()) A map(int, input().split()) map int input().split() ().split () input split B from fractions import gcd g = gcd(A,B) g gcd(A,B) gcd A B def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    fct = list(set(fct))
    return fct factorize b = 2 b 2 fct = [] fct [] while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
     b * b <= n b * b b b n while n % b == 0:
            n //= b
            fct.append(b)
         n % b == 0 n % b n b 0 n //= b n b fct.append(b) fct.append fct append b b = b + 1 b b + 1 b 1 if n > 1:
        fct.append(n)
     n > 1 n 1 fct.append(n) fct.append fct append n fct = list(set(fct)) fct list(set(fct)) list set(fct) set fct return fct fct n n f = factorize(g) f factorize(g) factorize g ans = len(f)+1 ans len(f)+1 len(f) len f 1 print(ans) print ans A, B = map(int, input().split()) map(int, input().split()) A g = gcd(A,B) gcd(A,B) g B = map(int, input().split()) map(int, input().split()) B f = factorize(g) factorize(g) f def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    fct = list(set(fct))
    return fct def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    fct = list(set(fct))
    return fct factorize ans = len(f)+1 len(f)+1 ans
A, B = map(int, input().split())
from fractions import gcd
g = gcd(A,B)

#素因数分解して列挙する関数、約数列挙ではない！
def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    fct = list(set(fct))
    return fct

f = factorize(g)
ans = len(f)+1
print(ans)