CodeEff/ECCO huggingface dataset:
# Original solution
from math import sqrt

A, B = list(map(int, input().split()))

def divisor(a, b):
    max_num = int(sqrt(a))
    divisor_list = []
    for i in range(1, max_num + 1):
        if a % i == 0 and b % i == 0:
            divisor_list.append(i)
            # for j in divisor_list:
            #     if a % (i*j) == 0 and b % (i*j) == 0:
            #         divisor_list.append(i)
            # divisor_list.append(i)
        tmp = a//i
        if a % tmp == 0 and b % tmp == 0:
            divisor_list.append(tmp)
            # for j in divisor_list:
            #     if a % (tmp*j) == 0 and b % (tmp*j) == 0:

    return list(set(divisor_list))

common_list = divisor(A, B)
common_list.sort()

# print(common_list)

length = len(common_list)
max_common = common_list[-1]
prods = []
dic = {c: 0 for c in common_list}

for i in range(1, length):
    for j in range(1, length):
        prod = common_list[i] * common_list[j]
        if prod > max_common:
            continue
        else:
            dic[prod] = 1
ans = 0
for c in common_list:
    if dic[c] == 0:
        ans += 1
        # print(c)

print(ans)

# Optimized solution


A, B = list(map(int, input().split()))

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

a_fac = factorization(A)
b_fac = factorization(B)
ans = 0
is_one = False
for af in a_fac:
    for bf in b_fac:
        if af[0] == bf[0]:
            ans += 1
            if af[0] == 1:
                is_one = True
if is_one:
    print(ans)
else:
    print((ans+1))
# Original solution
a,b = list(map(int,input().split()))
c = []
for i in range(2,min(a,b)+1):
    if a % i == 0 and b % i == 0:
       c.append(i)
for k in range(len(c)):
    for j in range(len(c)):
        if (c[k])%(c[j])==0:
           if c[k] != c[j]:
              c[k] =2
c.append(1)
print((len(set(c))))

# Optimized solution
a,b=list(map(int,input().split()))
def prime_factorize(n):
  a=[]
  while n%2==0:
    a.append(2)
    n//=2
  f=3
  while f*f<=n:
    if n%f==0:
      a.append(f)
      n//=f
    else:
      f+=2
  if n!=1:
    a.append(n)
  return a
print((1+len(set(prime_factorize(a))&set(prime_factorize(b)))))
# Original solution
a, b = list(map(int, input().split()))
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort()
    return divisors

def common_divisors(k,j):
  c = make_divisors(k) + make_divisors(j)
  return [x for x in set(c) if c.count(x) > 1]
  
kouyakusuu = common_divisors(a,b)
count = 0
for k in kouyakusuu:
  if len(make_divisors(k)) == 1 or make_divisors(k)==[1,k]:      
   	count+=1

print(count)


# Optimized solution
a, b = list(map(int, input().split()))
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort()
    return divisors

def common_divisors(k,j):
  c = make_divisors(k) + make_divisors(j)
  return [x for x in set(c) if c.count(x) > 1]

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)
    return fct
  
kouyakusuu = common_divisors(a,b)

aa=factorize(a)
bb=factorize(b)
l = list(set(aa))+list(set(bb))
ll = [x for x in set(l) if l.count(x) > 1]

print((len(ll)+1))
# Original solution
def gcd(m, n):
    a, b = m, n
    r = a % b
    while r != 0:
        a, b = b, r
        r = a % b
    return b

def divisors(x):
    D = []
    for i in range(1, int(x**0.5) + 1):
        if x % i == 0:
            D.append(i)
            if i != x**0.5:
                D.append(x // i)
    return D


a, b = list(map(int, input().split()))

CD = divisors(gcd(a, b))

ans = 1
for cd in CD:
    if len(divisors(cd)) == 2:
        ans += 1

print(ans)


# Optimized solution
def gcd(x, y):
    a, b = x, y
    r = a % b
    while r != 0:
        a, b = b, r
        r = a % b
    return b

def divisors(x):
    D = []
    for i in range(1, int(x**0.5) + 1):
        if x % i == 0:
            D.append(i)
            if i != x**0.5:
                D.append(x // i)
    D.sort()
    return D

def isprime(x):
    t = 1
    for i in range(2, int(x**0.5) + 1):
        if x % i == 0:
            t = 0
            break
    if t == 1 and x != 1:
        return True
    else:
        return False


a, b = list(map(int, input().split()))

CD = divisors(gcd(a, b))

ans = 1
for cd in CD:
    if isprime(cd):
        ans += 1

print(ans)
# Original solution
a,b=list(map(int,input().split()))
def gcd(a, b):
  while b:
    a, b = b, a % b
  return a
def cf(x1,x2):
    cf=[]
    cf.append(1)
    for i in range(2,min(x1,x2)+1):
        if x1 % i == 0 and x2 % i == 0:
            cf.append(i)
    return cf

ans = cf(a,b)
if len(ans) == 1:
  print((len(ans)))
  exit()
i = len(ans)-1
j = len(ans)-1
while i != 1:
  if gcd(ans[i], ans[j-1]) != 1:
    ans.remove(ans[i])
    i = len(ans)-1
    j = len(ans)-1
    continue
  j -= 1
  if j == 0:
    i -= 1
    j = i - 1

print((len(ans)))

# Optimized solution
a,b=list(map(int,input().split()))
def gcd(a, b):
  return a if b == 0 else gcd(b, a%b)

def factorize(n):
  a = []
  while n % 2 == 0:
    a.append(2)
    n /= 2
  f = 3
  while f * f <= n:
    if n % f == 0:
      a.append(f)
      n /= f
    else:
      f += 2
  if n != 1: a.append(n)
  return a

print((len(set(factorize(gcd(a,b))))+1))
# Original solution
import collections as col

def prime(n):
    ans = []
    num = n
    for i in range(2,int(n**0.5)+1):
        if i%2==0 and i!=2: continue
        while num%i == 0: num //= i ; ans.append(i)
    if num != 1: ans.append(num)
    return ans

def gcd(a,b): return gcd(b,a%b) if a%b else b

a,b = list(map(int,input().split()))
primes = prime(gcd(a,b))
cnt = col.Counter(primes)
ans = len(cnt) + 1
print(ans)
        


# Optimized solution
import collections as col
import math

def prime(n):
    ans = []
    num = n
    for i in range(2,int(n**0.5)+1):
        if i%2==0 and i!=2: continue
        while num%i == 0: num //= i ; ans.append(i)
    if num != 1: ans.append(num)
    return ans

def gcd(a,b): return gcd(b,a%b) if a%b else b

a,b = list(map(int,input().split()))
primes = prime(gcd(a,b)) #math.gcdは使用禁止？
cnt = col.Counter(primes)
ans = len(cnt) + 1
print(ans)
# Original solution
p,q=list(map(int,input().split()))
if q>p:
  p,q=q,p
def gcd(a,b):
  if b==0:
    return a
  else:
    return gcd(b,a%b)
g=gcd(p,q)
d=int(g**0.5)
res=set()
for i in range(2,g+1):
  if g%i!=0:
    continue
  else:
    res.add(i)
    while g%i==0:
      g=int(g/i)
print((len(res)+1))

# Optimized solution
p,q=list(map(int,input().split()))
if q>p:
  p,q=q,p
  
def gcd(a,b):
  if b==0:
    return a
  else:
    return gcd(b,a%b)
  
def prime_factorize(n):
    a = set()
    while n % 2 == 0:
        a.add(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.add(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.add(n)
    return a
  
g=gcd(p,q)
res=prime_factorize(g)
print((len(res)+1))
# Original solution
A, B = list(map(int, input().split()))

lst = []
for i in range(1, min(A, B)+1):
    if A % i == 0 and B % i == 0:
        lst.append(i)
        
import math

cnt = 0

for j in lst:    
    flag = 1
    for k in range(2, int(math.sqrt(j))+1):
        if j % k == 0:
            flag = 0
            break
    cnt += flag

print(cnt)

# Optimized solution
A, B = list(map(int, input().split()))

import math

if A < B:
    A, B = B, A
    
while A % B != 0:
    A, B = B, A%B
    
ans = 1

for i in range(2, int(math.sqrt(B))+1):
    if B % i == 0:
        ans += 1
        
        while B % i == 0:
            B //= i
            
if B > 1:
    ans += 1
    
print(ans)
# Original solution
a, b = list(map(int, input().split()))

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

agcd = gcd(a,b)

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

def is_prime(n):
    if n == 1: return False

    for k in range(2, int(n**0.5) + 1):
        if n % k == 0:
            return False

    return True

x = make_divisors(agcd)
ans = 1
for _x in x:
    ans += is_prime(_x)

print(ans)


# Optimized solution
a, b = list(map(int, input().split()))

# get GCD(Gratest Common Divisor: 最大公約数)
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

# get divisors(公約数)
def divisors(n):
    nums = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            nums.append(i)
            if i != n // i:
                nums.append(n//i)
    return sorted(nums)

# is prime(Prime Number: 素数)
def is_prime(n):
    if n == 1: return False
    for k in range(2, int(n**0.5) + 1):
        if n % k == 0: return False
    return True

x = divisors(gcd(a, b))

ans = 1
for _x in x:
    ans += is_prime(_x)

print(ans)
# Original solution
import math
a,b = (int(x) for x in input().split())
saidai = 1
c = []
def yakusuu(x,y):
    return(y,x % y)

def cont(z):
    n = 0
    while True:
        if n - int(z ** (1/2)) + 1 == 0:
            c.append(z)
            break
                
        for j in range(2,int(z ** (1/2)) + 1):
            if z % j == 0:
                z = z // j
                c.append(j)
                n = 0
                break
        else:
            n = n + 1

saidai = math.gcd(a,b)


cont(saidai)
if max(c) == 1:
   print((1))
   exit()
print((len(set(c)) + 1))


# Optimized solution
import math
a,b = (int(x) for x in input().split())
saidai = 1

def yakusuu(x,y):
    return(y,x % y)

def cont(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])
    if arr==[]:
        arr.append([n, 1])
    return arr

saidai = math.gcd(a,b)


d = cont(saidai)
if d[0] == [1,1]:
    print((1))
    exit()
print((len(d) + 1))
# Original solution
a, b = list(map(int, input().split()))

a_set = set()
b_set = set()

i = 2
while a!=1:
  if a%i==0:
    while a%i==0: 
      a//=i
    a_set.add(i)
  i+=1

i = 2
while b!=1:
  if b%i==0:
    while b%i==0: 
      b//=i
    b_set.add(i)
  i+=1  
  
print((len(a_set&b_set)+1))

# Optimized solution
a, b = list(map(int, input().split()))

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)
    return fct

print((len(set(factorize(a))&set(factorize(b)))+1))
# Original solution
A, B = [int(x) for x in input().split()]

def prime_factorization(n):
    i = 2
    factors = []
    while i * i <= n:
        if n % i:
            i += 1
        else:
            n //= i
            factors.append(i)
    if n > 1:
        factors.append(n)
    return factors

Aprimes = prime_factorization(A)
Bprimes = set(prime_factorization(B))

ans = 1
ansset = set()
for a in Aprimes:
    if a in ansset:
        continue
    if a in Bprimes:
        ansset.add(a)
        ans += 1

print(ans)



# Optimized solution
import  math

A, B = [int(x) for x in input().split()]


def prime_factorization(n):
    i = 2
    factors = []
    while i * i <= n:
        if n % i:
            i += 1
        else:
            n //= i
            factors.append(i)
    if n > 1:
        factors.append(n)
    return factors

C = math.gcd(A, B)




print((len(set(prime_factorization(C))) + 1))
# Original solution
a,b = list(map(int,input().split()))
while b != 0:
  a,b = b,a%b
pr = set()
i = 2
while i ** 2 <= a:
  while a % i == 0:
    a //= i
    pr.add(i)
  i += 1
pr.add(a)
pr.add(1)
print((len(pr)))

# Optimized solution
#16:44
a,b = list(map(int,input().split()))
while b > 0:
  a,b = b,a%b
prime = []
for i in range(2,int(a**.5)+1):
  if a % i == 0:
    p,q = i,0
    while a % i == 0:
      a //= i
      q += 1
    prime.append([p,q])
if a != 1:
  prime.append([a,1])
print((len(prime)+1))
# Original solution
import math
a,b = list(map(int,input().split()))
p = []
while(b!=0):
  a,b=b,a%b
x = a
for i in range(a+1):
  p.append(True)
p[0],p[1] = False,True
for i in range(2,a+1):
  j=0
  if p[i]:
    while x%i==0:
      p[i] = True
      x//=i
    j=i*2
    if a%i!=0:
      p[i] = False
    while j<=a:
      p[j] = False
      j+=i
print((p.count(True)))

# Optimized solution
a,b = list(map(int,input().split()))
f = [1]
while(b!=0):
  a,b=b,a%b
while a%2==0:
  f.append(2)
  a//=2
p = 3
while p*p<=a:
  if a%p==0:
    f.append(p)
    a//=p
  else:
    p+=2
if a!=1:
  f.append(a)
print((len(set(f))))
# Original solution
def gcd(x, y):
  if y == 0:
    return x
  else:
    return gcd(y, x % y) 

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    return divisors

def isPrime(n):
  if n <= 2:
    return True
  for p in range(2, n):
      if n % p == 0:
        return False
  return True
    
a,b = list(map(int,input().split()))
gcd = gcd(a,b)
yks = make_divisors(gcd)
ans = 0
for i in yks:
  if isPrime(i):
    ans +=1
print(ans)

# Optimized solution
def gcd(x, y):
  if y == 0:
    return x
  else:
    return gcd(y, x % y) 

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

def isPrime(n):
  if n <= 2:
    return True
  m = int((n**0.5)//1 + 1)
  for p in range(2, m):
      if n % p == 0:
        return False
  return True
    
a,b = list(map(int,input().split()))
gcd = gcd(a,b)
yks = make_divisors(gcd)
ans = 0
for i in yks:
  if isPrime(i):
    ans +=1
print(ans)
# Original solution
def gcd(g1, g2):
    x = min(g1, g2)
    y = max(g1, g2)

    if y % x == 0:
        return x
    else:
        return gcd(x, y % x)


def prime_factorize(n):
    p = []
    while n % 2 == 0:
        if 2 not in p:
            p.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            if f not in p:
                p.append(f)
                n //= f
        else:
            f += 2
    if n != 1 and n not in p:
        p.append(n)
    return p


a, b = list(map(int, input().split()))
q = prime_factorize(gcd(a, b))
# print(q)
print((len(q) + 1))


# Optimized solution
def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y)


def prime_factorize(n):
    p = []
    while n % 2 == 0:
        if 2 not in p:
            p.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            if f not in p:
                p.append(f)
            n //= f
        else:
            f += 2
    if n != 1 and n not in p:
        p.append(n)
    return p


a, b = list(map(int, input().split()))
q = prime_factorize(gcd(a, b))
# print(q)
print((len(q) + 1))
# Original solution
import math
A, B = list(map(int, input().strip().split()))

minAB = min(A,B);

upper = int(math.sqrt(minAB+1))
ans = 1

for i in range(2, minAB+1):
    if A % i != 0 or B % i != 0:
        continue;
    falg = True
    for j in range(2, i-1):
        if(i % j == 0):
            falg = False
            break
    if falg:
        ans+=1
        
print(ans)

# Optimized solution
import math
A, B = list(map(int, input().strip().split()))

divisors = []

minAB = min(A,B)
maxAB = max(A,B)
upper = int(math.sqrt(minAB+1) + 1)
ans = 1

for i in range(1, upper):
    if minAB % i == 0:
        divisors.append(i)
        if i != minAB//i:
            divisors.append(minAB//i)

divisors.sort()
#print(divisors)

flag = [True] * len(divisors)
for i, num in enumerate(divisors):
    if maxAB % num != 0:
        flag[i] = False
        continue
    for x in divisors:
        if x == 1 :
            continue
        if x > math.sqrt(num):
            break
        if num % x ==0:
            flag[i] = False
            break

print((flag.count(True)))
# Original solution
A, B = list(map(int, input().split()))

def gcd(a, b):
    if b == 0: return a
    return gcd(b, a % b)

def isPrime(x):
    for i in range(2, int(x ** 0.5) + 1):
        if x % i == 0: return False
    return True

count = 1
num = gcd(A, B)
cur = 2
while num != 1:
    if isPrime(cur) and num % cur == 0:
        while num % cur == 0:
            num //= cur
        count += 1
    cur += 1

print(count)


# Optimized solution
A, B = list(map(int, input().split()))

def gcd(a, b):
    if b == 0: return a
    return gcd(b, a % b)

num = gcd(A, B)

if num < 2:
    print((1))
    quit()

length = int(num ** 0.5) + 2
isPrime = [True for i in range(length)]
isPrime[2] = True
for i in range(2, length):
    if isPrime[i]:
        for j in range(2 * i, length, i):
            isPrime[j] = False

count = 1

cur = 2
while num != 1 and cur < length:
    if isPrime[cur] and num % cur == 0:
        while num % cur == 0:
            num //= cur
        count += 1
    cur += 1

print((count + (num != 1)))
# Original solution
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

import itertools
import math
def main():
    a,b=list(map(int,input().split()))
    x=[y for y in make_divisors(a) if b%y==0]
    ans = 0
    for e in itertools.product([0,1], repeat=len(x)):
        t = [x[i] for i,v in enumerate(e) if v==1]
        for i, j in itertools.combinations(t, 2):
            if math.gcd(i, j) != 1:
                break
        else:
            ans = max(ans, e.count(1))
    print(ans)
                
if __name__ == "__main__":
    main()

# Optimized solution
from functools import lru_cache

def main():
    a,b=[set(prime_factorize(int(x))) for x in input().split()]
    print((len(a&b)+1))

@lru_cache(maxsize=None)
def primes(n:int) -> list:
    '''n以下の全素数をlistで返す'''
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]

# 素数判定（単純な素数判定なら十分早い。大量にやる場合はX in primesがよさそう）
@lru_cache(maxsize=None)
def is_prime(n: int) -> bool:
    '''引数nが素数であればTrue、そうでなければFalseを返す'''
    if n == 1:
        return False
    elif n == 2:
        return True
    elif n % 2 == 0:
        return False
    
    for i in range(3, int(n**0.5)+1, 2):
        if n % i == 0:
            return False
    return True

# 素因数分解
@lru_cache(maxsize=None)
def prime_factorize(n: int) -> list:
    '''引数nの素因数分解結果のlistを返す。'''
    arr = []
    # 2で割り続け奇数まで還元する
    while n % 2 == 0:
        arr.append(2)
        n //= 2
    # sqrt(n)までの素数で試し割
    for f in primes(int(n**0.5)):
        while n % f == 0:
            arr.append(f)
            n //= f
    if n != 1:
        arr.append(n)
    return arr

#約数リスト
def make_divisors(n: int) -> list:
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]
        
if __name__ == "__main__":
    main()
# Original solution
a, b = list(map(int, input().split()))
def primes(n):
  if n >= 2:
    prime_nums = [2]
    for i in range(3, n + 1):
      for p in prime_nums:
        if i % p == 0:
          break
      else:
        prime_nums.append(i)
  return prime_nums
if a == 1 or b == 1:
  print((1))
else:
  Z = primes(max(a, b))
  ans = 1
  for i in range(len(Z)):
    if a%Z[i] == b%Z[i] == 0:
      ans += 1
  print(ans)

# Optimized solution
import sys 
input = sys.stdin.readline
a, b = list(map(int, input().split()))
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

A = set(prime_factorize(a))
B = set(prime_factorize(b))
ans = A&B
print((len(ans)+1))
# Original solution
import math

def sosuucheck(val):
    flg = True
    max_search = math.ceil(math.sqrt(val))
    if val <= 3:
        pass
    else:
        for i in range(2, max_search+1):
            if val % i == 0:
                flg = False
                break
    return flg

def yakusuu(a):
    t = []
    for i in range(1,a+1):
        if a%i==0:
            t.append(i)
    return t

def kouyakusuu(a,b):
    t = []
    u = 0
    d = 0
    if a>b:
        u = a
        d = b
    else:
        u = b
        d = a
    for i in range(1,d+1):
        if u%i==0 and d%i==0:
            t.append(i)
    return t

a,b = list(map(int,input().split()))

#t = list(map(yakusuu,kouyakusuu(a,b)))
t = kouyakusuu(a,b)
sn = 0
for i in t:
    if sosuucheck(i):
        sn += 1


print(sn)

# Optimized solution
import math

A, B = [int(item) for item in input().split()]

def gdc(A, B):
    if B == 0:
        return A
    else:
        return gdc(B, A % B)

def chk_pn(num):
    flag = True
    if num  <= 3:
        pass
    else:
        for i in range(2, int(math.sqrt(num)) + 1):
            if num % i == 0:
                flag = False
                break
    return flag

def mk_factor(num):
    max_divisor = int(math.sqrt(num))+1
    divisor = 2
    factor_list = [1]

    while divisor <= max_divisor:
        if num % divisor == 0:
            factor_list.append(divisor)
            num /= divisor
        else:
            divisor += 1
    if num != 1.0:
        factor_list.append(num)
    return factor_list

GDC = gdc(A, B)
#pn_factor = [i for i in mk_factor(GDC) if chk_pn(i) is True]

print((len(set(mk_factor(GDC)))))
# Original solution
a, b = list(map(int, input().split()))
nums = [x for x in reversed(list(range(2, min(a, b) + 1))) if a % x == b % x == 0]
res = 1
while nums:
    x = nums.pop()
    res += 1
    nums = [y for y in nums if y % x != 0]
print(res)

# Optimized solution
a, b = list(map(int, input().split()))

def factorization(n):
    arr = set()
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            while temp % i == 0:
                temp //= i
            arr.add(i)

    if temp != 1:
        arr.add(temp)

    if not arr:
        arr.add(n)

    return arr

if a == b == 1:
    print((1))
else:
    fa = factorization(a)
    fb = factorization(b)
    res = 1
    for n in fa:
        if n in fb:
            res += 1
    print(res)