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


def prime_factorize(n):
    """素因数分解する。"""
    def facs(n):
        """試し割り法における割る数を生成する。"""
        yield 2
        max_prime = int(pow(n, 0.5)) + 2
        for x in range(3, max_prime, 2):
            yield x

    ans = set()
    for fac in facs(n):
        while n % fac == 0:
            ans.add(fac)
            n //= fac
    if n != 1:
        ans.add(n)
    return ans


def gcd_list(numbers):
    # これじゃすべての最大公約数を出しているだけ。
    # すべての組み合わせにおいて最大公約数が1でなくてはいけない。
    return reduce(math.gcd, numbers)


def main():
    a, b = [int(x) for x in input().split()]
    gcd_ = math.gcd(a, b)
    primes = prime_factorize(gcd_)
    print((len(primes) + 1))


if __name__ == '__main__':
    main()


# Optimized solution
import math
from functools import reduce


def prime_factorize(n):
    """素因数分解する。"""
    def facs(n):
        """試し割り法における割る数を生成する。"""
        yield 2
        max_prime = int(pow(n, 0.5)) + 2
        for x in range(3, max_prime, 2):
            yield x

    ans = set()
    for fac in facs(n):
        if n % fac == 0:
            ans.add(fac)
            while n % fac == 0:
                n //= fac
    if n != 1:
        ans.add(n)
    return ans


def gcd_list(numbers):
    # これじゃすべての最大公約数を出しているだけ。
    # すべての組み合わせにおいて最大公約数が1でなくてはいけない。
    return reduce(math.gcd, numbers)


def main():
    a, b = [int(x) for x in input().split()]
    gcd_ = math.gcd(a, b)
    primes = prime_factorize(gcd_)
    print((len(primes) + 1))


if __name__ == '__main__':
    main()
# Original solution
a,b=list(map(int,input().split()))
import math
c= math.gcd(a,b)
l=[]
i=2
while i<=c:
  if c % i==0:
    c=c//i
    l.append(i)
  else:
    i+=1
print((len(set(l))+1))


# Optimized solution
a,b=list(map(int,input().split()))
import math
c= math.gcd(a,b)
c2=c
l=[]
i=2
while i<=c:
  if c % i==0:
    c=c//i
   
    l.append(i)
  else:
    i+=1
  if i*i-1>c:
    l.append(c)
    break
  
print((len(set(l))+1))
# Original solution
from collections import defaultdict
from sys import stdin
input = stdin.readline


def prime_fatorization(n):
  # O(sqrt(n))
  # a = []
  a = defaultdict(int)
  while not(n % 2):
    # a.append(2)
    a[2] += 1
    n //= 2
  f = 3
  while f * f <= n:
    if not(n % f):
      # a.append(f)
      a[f] += 1
      n //= f
    else:
      f += 2
  if n != 1:
    # a.append(n)
    a[n] += 1
  return a


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

  aprime = prime_fatorization(A)
  bprime = prime_fatorization(B)

  aset = set()
  bset = set()

  for ap in list(aprime.keys()):
    aset.add(ap)

  for bp in list(bprime.keys()):
    bset.add(bp)

  print((1+len(aset & bset)))


if(__name__ == '__main__'):
  main()


# Optimized solution
from collections import defaultdict
from sys import stdin
input = stdin.readline


def prime_fatorization(n):
  # O(sqrt(n))
  # a = []
  a = defaultdict(int)
  while not(n % 2):
    # a.append(2)
    a[2] += 1
    n //= 2
  f = 3
  while f * f <= n:
    if not(n % f):
      # a.append(f)
      a[f] += 1
      n //= f
    else:
      f += 2
  if n != 1:
    # a.append(n)
    a[n] += 1
  return a


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

  aprime = prime_fatorization(A)
  bprime = prime_fatorization(B)

  aset = set(aprime.keys())
  bset = set(bprime.keys())

  print((1+len(aset & bset)))


if(__name__ == '__main__'):
  main()
# Original solution
def get_common_divisor_list(a,b):
	cd_list = []
	for i in range(1,min(a,b)+1):
		if a%i == 0 and b%i == 0:
			cd_list.append(i)
	return cd_list

def is_coprime(a,b):
	cd_list = get_common_divisor_list(a,b)
	if len(cd_list) == 1 and 1 in cd_list :
		return True
	return False

from math import sqrt
def is_prime(n):
	if n==1:
		return False
	for k in range(2,int(sqrt(n))+1):
		if n%k == 0:
			return False
	return True

def main():
	A,B = list(map(int,input().split()))
	cds = get_common_divisor_list(A,B)
	res = []
	for cd in cds :
		if cd == 1 :
			res.append(1)
			continue
		if is_prime(cd):
			res.append(cd)
	print((len(res)))
main()

# Optimized solution
import math
def trial_division(n):
	factor = []
	while n%2 == 0:
		factor.append(2)
		n //= 2
	f = 3
	while f <= math.sqrt(n):
		if n%f == 0:
			factor.append(f)
			n //= f
		else :
			f += 2
	if n!= 1:
		factor.append(n)
	return factor

def main():
	cds = set()
	cds.add(1)
	a,b = list(map(int,input().split()))
	primes_a = trial_division(a)
	primes_b = trial_division(b)
	if primes_a != None and primes_b != None :
		for prime in primes_a:
			if prime in primes_b:
				cds.add(prime)
	print((len(cds)))
main()
# Original solution
a,b=list(map(int,input().split()))

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

A=prime_factorization(a)
B=prime_factorization(b)

ans=0
for _a in A:
  if B.count(_a):
    ans+=1
print((ans+1))


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

def prime_factorization(n):
  if n==1:
    return [1]
  else:
    i=2
    ans=[]
    k=int(n**0.5)+1
    for j in range(2,k+1):
      if n==1: break
      if n%j==0:
        n//=j
        ans.append(j)
        while n%j==0:
          n//=j
    if len(ans):
      ans.append(1)
      if n!=1:
        ans.append(n)
      return ans
    else:
      return [1,n]

A=prime_factorization(a)
B=prime_factorization(b)
#print(A)
#print(B)

print((len(set(A)&set(B))))
# Original solution
import math
a,b=list(map(int,input().split()))
gcd=math.gcd(a,b)

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

print((len(prime_factorization(gcd))+1))
#print(prime_factorization(gcd))

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

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

print((len(prime_factorization(gcd))+1))
#print(prime_factorization(gcd))
# Original solution
import math
a,b=list(map(int,input().split()))
gcd=math.gcd(a,b)

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

print((len(prime_factorization(gcd))+1))

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

def prime_factorization(n):
  i=2
  prime=[]
  if n%i==0:
    n//=i
    prime.append(2)
    while n%i==0:
      n//=i
  i+=1
  k=int(n**0.5)+1
  for j in range(i,k+1,2):
    if n%j==0:
      n//=j
      prime.append(j)
      while n%j==0:
        n//=j
  if n>1:
    prime.append(n)
  return prime

print((len(prime_factorization(gcd))+1))
# Original solution
import math
import sys

M=list(map(int,input().split()))

def prime(i):
  k=[]
  maxi=i**0.5
  j=2
  moto=i
  while i>1:
    if i%j==0:
      k.append(j)
      i/=j
      j=2
    else:
      j+=1
  k.append(1)
  k=list(set(k))
  return k

a=set(prime(M[0]))
b=set(prime(M[1]))
print((len(list(a&b))))

# Optimized solution
import math
import sys

M=list(map(int,input().split()))


def prime(i):
  k=[]
  num=i
  j=2
  while j*j<=num:
    if i%j==0:
      i//=j
      k.append(j)
    else:
      j+=1
  if i!=1:
    k.append(i)
  k.append(1)
  return k

a=set(prime(M[0]))
b=set(prime(M[1]))
print((len(list(a&b))))
# Original solution
# -*- coding: utf-8 -*-
def c_div(a, b):
    my_list = []
    for i in range(2, min(a, b)+1):
        flag = True
        for item in my_list:
            if i % item == 0:
                flag = False
                break
        if flag and a % i == 0 and b % i == 0:
            my_list.append(i)
    return len(my_list)+1


# スペース区切りの整数の入力
a, b = list(map(int, input().split()))
print((c_div(a, b)))


# Optimized solution
# -*- coding: utf-8 -*-
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, b = list(map(int, input().split()))
a_list = prime_factorize(a)
a_set = set(a_list)
b_list = prime_factorize(b)
b_set = set(b_list)

print((len(a_set & b_set)+1))
# Original solution
a,b=list(map(int,input().split()))

# 素数だったら1を返す
def prime_number(n):
    for x in range(2,n):
        if n%x==0:
            return 0
    return 1

ans=0
m=min(a,b)//2+2
for i in range(1,m):
    if a%i==0 and b%i==0:
        ans+=prime_number(i)

print(ans)


# Optimized solution
import sys
read=sys.stdin.readline

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

def factorization(n):
    arr=set([1])
    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.add(i)
    if temp!=1:
        arr.add(temp)
    if arr==[]:
        arr.add(n)
    return arr


print((len(factorization(A)&factorization(B))))
# Original solution
def gcd(a,b):
	return gcd(b,a%b) if b else a

a,b=list(map(int,input().split()))
c=gcd(a,b)
ans=1
cnt=2
while(cnt*cnt<c):
	bo=False
	while(c%cnt==0):
		if not bo:
			ans+=1
			bo=True
		c//=cnt
	cnt+=1
if c!=1:
	ans+=1
	
print(ans)

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

a,b=list(map(int,input().split()))
c=gcd(a,b)
ans=1
cnt=2
while(cnt*cnt<=c):
	bo=False
	while(c%cnt==0):
		if not bo:
			ans+=1
			bo=True
		c//=cnt
	cnt+=1
if c!=1:
	ans+=1

print(ans)
# Original solution
# 以下ペースト可
# start 21:14
a, b = [int(item) for item in input().split()]

if b > a:
    c = a
    a = b
    b = c


# 最大公約数を求める
def gcd(a, b):
    while b > 1:
        a, b = b, a%b
    return a

# 公約数でかつ素数の_listを求める
prime_devisor_list = [1]

import math

def is_prime(num):
    if num in [1, 2]:
        return True
    else:
        for i in range(2, int(math.sqrt(num)) + 1):
            if num % i == 0:
                return False
        return True

for i in range(2, gcd(a, b)+1):
    if a % i == 0 and b % i == 0:
        # i can be ans
        # check pirme

        if is_prime(i):
            prime_devisor_list.append(i)

# 数をこたえる
print((len(prime_devisor_list)))


# Optimized solution
# start 21:14
a, b = [int(item) for item in input().split()]

# 素因数リスト
import math
def factor(num):
    divisor_list = [1]
    divisor = 2
    max_prime = int(math.sqrt(num))
    while max_prime >= divisor:
        if num % divisor == 0:
            divisor_list.append(divisor)
            num //= divisor

        else:
            divisor += 1
    divisor_list.append(num)
    return divisor_list

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

cd_list = set(factor(gcd(a, b)))

print((len(cd_list)))
# Original solution
def division(n):
    if n < 2:
        return [1]

    prime_factors = [1]

    for i in range(2,int(n**0.5)+1):
        while n % i == 0:
            prime_factors.append(i)
            n //= i
    if n > 1:
        prime_factors.append(n)

    return prime_factors

a,b = list(map(int,input().split()))
da = set(division(a))
db = set(division(b))
cnt = 0
for i in da:
    if i in db:
        cnt += 1
print(cnt)

# Optimized solution
from math import gcd
def division(n):
    if n < 2:
        return [1]
    prime_factors = [1]
    for i in range(2,int(n**0.5)+1):
        while n % i == 0:
            prime_factors.append(i)
            n //= i
    if n > 1:
        prime_factors.append(n)
    return prime_factors

a,b = list(map(int,input().split()))
d = set(division(gcd(a,b)))
print((len(d)))
# Original solution
#!/usr/bin/python3

import sys
# input = sys.stdin.readline
sys.setrecursionlimit(100000)
MOD = 10 ** 9 + 7

#N = int(input())
#A = [int(x) for x in input().split()]
#V = [[0] * 100 for _ in range(100)]
def gcd(x, y):
    while (y):
        x, y = y, x % y
    return x


def divisor_list(n):
    # ret = set()
    ret = dict()
    ret[1] = 1
    i=2
    while n!=1:
        while n % i == 0:
            ret[i] = ret.get(i,0) + 1
            n /= i
        i+=1
    return ret

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

cm = set(dA.keys()).intersection(set(dB.keys()))

print((len(cm)))

# Optimized solution
#!/usr/bin/python3

import sys
# input = sys.stdin.readline
sys.setrecursionlimit(100000)
MOD = 10 ** 9 + 7

#N = int(input())
#A = [int(x) for x in input().split()]
#V = [[0] * 100 for _ in range(100)]

def prime_decomposition(n):
    i = 2
    table = []
    while i * i <= n:
        while n % i == 0:
            n //= i
            table.append(i)
        i += 1
    if n > 1:
        table.append(n)
    return table

A,B = [int(x) for x in input().split()]
dA = set(prime_decomposition(A))
dB = set(prime_decomposition(B))

cm = dA.intersection(dB)
cm.add(1)

print((len(cm)))
# Original solution
import math
A, B = list(map(int,input().split()))
def yakusuu(N):
    P = set([1,N])
    for k in range(2,math.floor(math.sqrt(N))+1):
        if N % k == 0:
            P.add(k)
            P.add(N//k)
    return P
def gcd(a,b):
    if b == 0:
        return a
    return gcd(b,a%b)
C = sorted(list(yakusuu(A)&yakusuu(B)))
N = len(C)
if N == 1:
    print((1))
else:
    ans = 0
    for k in range(N):
        f = 1
        for l in range(k):
            if gcd(C[k],C[l]) != 1:
                f = 0
                break
        ans += f
    print(ans)


# Optimized solution
A, B = list(map(int,input().split()))
P = [1]
a = set([1,A])
b = set([1,B])
for k in range(2,2+int(max(A,B)**(1/2))):
    if A%k == 0 and B%k == 0:
        P.append(k)
        a.add(A//k)
        b.add(B//k)
    elif A%k == 0:
        a.add(A//k)
    elif B%k == 0:
        b.add(B//k)

P += list(a&b)
P.sort()
U = set([])
def gcd(a,b):
    if b == 0:
        return a
    return gcd(b,a%b)
for e in P:
    flag = 1
    for used in U:
        if gcd(e,used) != 1:
            flag = 0
            break
    if flag == 1:
        U.add(e)
print((len(U)))
# Original solution

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

a, b = list(map(int, input().split()))
max = gcd(a, b)
pf=[]

#print(max)
tmp=max
i=2

while tmp != 1:
    if tmp%i == 0:
        pf.append(i)
        tmp=tmp/i
    else:
        i+=1

#print(pf)
spf = set(pf)
#print(spf)
print((len(spf)+1))


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

a, b = list(map(int, input().split()))
max = gcd(a, b)
pf=[]

#print(max)
tmp=max
i=2
while tmp % 2 == 0:
    pf.append(2)
    tmp //= 2
f = 3
while f * f <= tmp:
    if tmp % f == 0:
        pf.append(f)
        tmp //= f
    else:
        f += 2
if tmp != 1:
    pf.append(tmp)


#print(pf)
spf = set(pf)
#print(spf)
print((len(spf)+1))
# Original solution

a,b = list(map(int,input().split()))
def gcd(x,y):
    if y == 0:
        return x
    else:
        return gcd(y,x%y)
def waru(max_gcd,x):
    if max_gcd%x != 0:
        return max_gcd
    else:
        return waru(max_gcd/i,x)

count = 0
max_gcd = gcd(a,b)

for i in range(2,max_gcd+1):
    if i > max_gcd:
        break
    if max_gcd%i == 0:
        count += 1
        max_gcd = waru(max_gcd,i)
print((count+1))


# Optimized solution

a,b = list(map(int,input().split()))
def gcd(x,y):
    if y == 0:
        return x
    else:
        return gcd(y,x%y)
def waru(max_gcd,x):
    if max_gcd%x != 0:
        return max_gcd
    else:
        return waru(max_gcd//i,x)

count = 0
max_gcd = gcd(a,b)

for i in range(2,max_gcd+1):
    if i*i > max_gcd:
        break
    if max_gcd%i == 0:
        count += 1
        max_gcd = waru(max_gcd,i)
if max_gcd == 1:
    print((count+1))
else:
    print((count+2))
# Original solution
a, b = list(map(int, input().split()))


def factorization_in_prime_number(x):
    prime_factor = []
    if x % 2 == 0:
        prime_factor.append(2)
    while x % 2 == 0:
        x //= 2
    m = int(x**.5) + 1
    for i in range(3, m, 2):
        if x % i == 0:
            prime_factor.append(i)
        while x % i == 0:
            x //= i
    if x != 1:
        prime_factor.append(x)
    return prime_factor


a_factor = factorization_in_prime_number(a)
b_factor = factorization_in_prime_number(b)
ans = len(set(a_factor) & set(b_factor)) + 1
print(ans)


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


def factorization_in_prime_number(x):
    prime_factor = []
    if x % 2 == 0:
        prime_factor.append(2)
    while x % 2 == 0:
        x //= 2
    m = int(x**.5) + 1
    for i in range(3, m, 2):
        if x % i == 0:
            prime_factor.append(i)
        while x % i == 0:
            x //= i
    if x != 1:
        prime_factor.append(x)
    # x=1 の時はからのリストを返す
    return prime_factor


a_factor = factorization_in_prime_number(a)
b_factor = factorization_in_prime_number(b)
ans = len(set(a_factor) & set(b_factor)) + 1
print(ans)
# Original solution
def gcd(x,y):
    if x<y:
        x,y = y,x
    while y>0:
        x,y = y,x%y
    return x
INFTY = 10**6
P = [1 for i in range(INFTY+1)]
P[0] = 0
P[1] = 0
for i in range(2,int((INFTY+1)**0.5)+1):
    for j in range(i*i,INFTY+1,i):
        P[j] = 0
Q = []
for i in range(INFTY):
    if P[i]==1:
        Q.append(i)
A,B = list(map(int,input().split()))
x = gcd(A,B)
cnt = 1
for y in Q:
    if x%y==0:
        cnt += 1
        while x%y==0:
            x = x//y
if x>1:
    cnt += 1
print(cnt)

# Optimized solution
def gcd(x,y):
    while y>0:
        x,y = y,x%y
    return x
P = [1 for _ in range(10**6)]
P[0]=0
P[1]=0
for i in range(2,10**3):
    for j in range(i*i,10**6,i):
        P[j] = 0
Q = []
for i in range(2,10**6):
    if P[i]==1:
        Q.append(i)
A,B = list(map(int,input().split()))
N = gcd(A,B)
R = [1]
for p in Q:
    if N%p==0:
        R.append(p)
        while N%p==0:
            N = N//p
if N>1:
    R.append(N)
print((len(R)))
# Original solution

import math


def primeFactorisation(x):
    res = set([1])
    while x % 2 == 0:
        res.add(2)
        x = x//2
    for i in range(3, int(math.sqrt(x)) + 1, 2):
        while (x % i == 0):
            res.add(i)
            x = x // i
    if (x > 2):
        res.add(x)
    return res


if __name__ == "__main__":
    a, b = list(map(int, input().split()))
    divisors = set([x for x in range(1, max(a, b)) if (a % x == 0 and b % x == 0)])
    coPrimedivisors = set([1])
    for x in divisors:
        coPrimedivisors = coPrimedivisors.union(set(primeFactorisation(x)))
    print((len(coPrimedivisors)))


# Optimized solution

import math


def primeFactorisation(x):
    res = set([1])
    while x % 2 == 0:
        res.add(2)
        x = x//2
    for i in range(3, int(math.sqrt(x)) + 1, 2):
        while (x % i == 0):
            res.add(i)
            x = x // i

    if (x > 2):
        res.add(x)
    return res


if __name__ == "__main__":
    prevs = []
    a, b = list(map(int, input().split()))
    fa = primeFactorisation(a)
    fb = primeFactorisation(b)
    fres = fa.intersection(fb)
    print((len(fres)))
# Original solution
A,B = [int(i) for i in input().split()]

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

def get_sieve_of_eratosthenes(n):#n以下の素数のリストを返す
    if not isinstance(n, int):
        raise TypeError('n is int type.')
    if n < 2:
        raise ValueError('n is more than 2')
    prime = [2]
    limit = int(n**0.5)
    data = [i + 1 for i in range(2, n, 2)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]
    return(data)

n=gcd(A,B)
ans = 1
if n==1:
    print((1))
else:
    plist = get_sieve_of_eratosthenes(n)
    for p in plist:
        if n==1:
            break
        if n%p==0:
            n = n//p
            ans+=1
    print(ans)

# Optimized solution
A,B = [int(i) for i in input().split()]

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

def get_sieve_of_eratosthenes(n):#n以下の素数のリストを返す
    if not isinstance(n, int):
        raise TypeError('n is int type.')
    if n < 2:
        raise ValueError('n is more than 2')
    prime = [2]
    limit = int(n**0.5)
    data = [i + 1 for i in range(2, n, 2)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]
    return(data)

n=gcd(A,B)
ans = 1
if n==1:
    print((1))
else:
    #plist = get_sieve_of_eratosthenes(n)
    #for p in plist:
    for p in range(2,int(n**0.5)+3):
        if n%p==0:
            ans+=1
            while n%p==0:
                n = n//p
    if n!=1:
        ans+=1
    print(ans)
# Original solution
import math
A,B = list(map(int,input().split()))
N = max(A,B)
prime = []

tA = A
tB = B
for i in range(2, math.ceil(N**0.5)+1):
    if tA%i==0 and tB%i==0:
        while tA%i==0:
            tA //= i
        while tB%i==0:
            tB //= i
        prime.append(i)

if tA!=1 or tB != 1:
    N = max(tA,tB)
    for i in range(2, N+1):
        if tA%i==0 and tB%i==0:
            while tA%i==0:
                tA //= i
            while tB%i==0:
                tB //= i
            prime.append(i)

# print(prime)
print((len(prime)+1))

# Optimized solution
import math
A,B = list(map(int,input().split()))
N = max(A,B)
prime = []

tA = A
tB = B
for i in range(2, math.ceil(N**0.5)+1):
    Aflag = False
    Bflag = False
    if tA%i==0:
        Aflag = True
        while tA%i==0:
            tA //= i
    if tB%i==0:
        Bflag = True
        while tB%i==0:
            tB //= i
    if Aflag == True and Bflag == True:
        prime.append(i)

if tA!=1 and tA == tB:
    prime.append(tA)

# print(prime)
print((len(prime)+1))
# Original solution
A, B = list(map(int, input().split()))

def make_divisors(a,b):
    ans = 1
    i = 2
    m = []
    while i <= min(A,B):
    #for i in range(1, int(min(a,b)**0.5)+1):
        if a%i == 0 and b%i == 0:
            ans += 1
            m.append(i)
        i += 1
        while i <= min(A,B):
            for mi in m:
                if i%mi == 0:
                    i += 1
                else:
                    break
            else:
                continue
            break
            #if i != n // i:
                #divisors.append(n//i)
    return ans

print((make_divisors(A,B)))


# 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

A_divisors = make_divisors(A)
ans = 1
m = []
for d in A_divisors:
    if d == 1: continue
    if B%d==0:
        for mi in m:
            if d%mi == 0:
                break
        else:
            ans += 1
            m.append(d)
            continue
        
print(ans)
# Original solution
A, B = list(map(int, input().split()))

def mygcd(a, b):
    if a < b:
        return mygcd(b, a)
    elif b == 0:
        return a
    else:
        return mygcd(b, a % b)

gcd = mygcd(A, B)

pfac = {}
gcd_tmp = gcd
for p in range(2, gcd + 1):
    if gcd_tmp < 2: break
    if gcd_tmp % p == 0:
        i_p = 0
        while gcd_tmp % p == 0:
            gcd_tmp //= p
            i_p += 1
        #
        pfac[str(p)] = i_p

# print("#", pfac)
        
print((1 + len(pfac)))

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

def mygcd(a, b):
    if a < b:
        return mygcd(b, a)
    elif b == 0:
        return a
    else:
        return mygcd(b, a % b)

gcd = mygcd(A, B)

import math

pfac = {}
gcd_tmp = gcd
for p in range(2, int(math.sqrt(gcd)) + 1):
    if gcd_tmp < 2: break
    if gcd_tmp % p == 0:
        i_p = 0
        while gcd_tmp % p == 0:
            gcd_tmp //= p
            i_p += 1
        #
        pfac[str(p)] = i_p
else:
    if gcd_tmp > 1: pfac[str(gcd_tmp)] = 1
    
# print("#", pfac)
        
print((1 + len(pfac)))