a, b = map(int, input().split())
roota = int(a ** 0.5)

def pcheck(n):
    rootn = int(n ** 0.5)
    for i in range(2, rootn + 2):
        if n % i == 0:
            return False
    return True

pa = []
for i in range(2, roota + 2):
    if a % i == 0:
        pa.append(i)
        while a % i == 0:
            a //= i
if (pcheck(a) == True) & (a != 1):
    pa.append(a)
cd = []
for i in range(len(pa)):
    if b % pa[i] == 0:
        cd.append(pa[i])
print(len(cd) + 1) a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b roota = int(a ** 0.5) roota int(a ** 0.5) int a ** 0.5 a 0.5 def pcheck(n):
    rootn = int(n ** 0.5)
    for i in range(2, rootn + 2):
        if n % i == 0:
            return False
    return True pcheck rootn = int(n ** 0.5) rootn int(n ** 0.5) int n ** 0.5 n 0.5 for i in range(2, rootn + 2):
        if n % i == 0:
            return False
     i range(2, rootn + 2) range 2 rootn + 2 rootn 2 if n % i == 0:
            return False
     n % i == 0 n % i n i 0 return False False return True True n n pa = [] pa [] for i in range(2, roota + 2):
    if a % i == 0:
        pa.append(i)
        while a % i == 0:
            a //= i i range(2, roota + 2) range 2 roota + 2 roota 2 if a % i == 0:
        pa.append(i)
        while a % i == 0:
            a //= i a % i == 0 a % i a i 0 pa.append(i) pa.append pa append i while a % i == 0:
            a //= i a % i == 0 a % i a i 0 a //= i a i if (pcheck(a) == True) & (a != 1):
    pa.append(a) (pcheck(a) == True) & (a != 1) pcheck(a) == True pcheck(a) pcheck a True a != 1 a 1 pa.append(a) pa.append pa append a cd = [] cd [] for i in range(len(pa)):
    if b % pa[i] == 0:
        cd.append(pa[i]) i range(len(pa)) range len(pa) len pa if b % pa[i] == 0:
        cd.append(pa[i]) b % pa[i] == 0 b % pa[i] b pa[i] pa i 0 cd.append(pa[i]) cd.append cd append pa[i] pa i print(len(cd) + 1) print len(cd) + 1 len(cd) len cd 1 a, b = map(int, input().split()) map(int, input().split()) a a //= i i a pa = [] [] pa roota = int(a ** 0.5) int(a ** 0.5) roota def pcheck(n):
    rootn = int(n ** 0.5)
    for i in range(2, rootn + 2):
        if n % i == 0:
            return False
    return True def pcheck(n):
    rootn = int(n ** 0.5)
    for i in range(2, rootn + 2):
        if n % i == 0:
            return False
    return True pcheck b = map(int, input().split()) map(int, input().split()) b cd = [] [] cd
a, b = map(int, input().split())
roota = int(a ** 0.5)

def pcheck(n):
    rootn = int(n ** 0.5)
    for i in range(2, rootn + 2):
        if n % i == 0:
            return False
    return True

pa = []
for i in range(2, roota + 2):
    if a % i == 0:
        pa.append(i)
        while a % i == 0:
            a //= i
if (pcheck(a) == True) & (a != 1):
    pa.append(a)
cd = []
for i in range(len(pa)):
    if b % pa[i] == 0:
        cd.append(pa[i])
print(len(cd) + 1)