CodeEff/ECCO huggingface dataset:
# Original solution
import math
a, b = list(map(int, input().split()))

def is_prime(num):
    if num == 2:
        return True
    elif num <  3 or num % 2 == 0:
        return False
    for i in range(3, int(math.sqrt(num)) + 1, 2):
        if num % i == 0:
            return False
    return True

if b > a:
    a, b = b, a
c = []
for i in range(1, int(math.sqrt(b))+1):
    if a%i == 0 and b%i == 0:
        if is_prime(i):
            c.append(i)
    k = b//i
    if a%k == 0:
        if is_prime(k):
            c.append(k)
print((len(set(c))+1))

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

def is_prime(num):
    if num == 2:
        return True
    elif num <  3 or num % 2 == 0:
        return False
    for i in range(3, int(math.sqrt(num)) + 1, 2):
        if num % i == 0:
            return False
    return True

if b > a:
    a, b = b, a
c = []
for i in range(1, int(math.sqrt(b))+1):
    if b%i == 0:
        k = b//i
        if a%k == 0:
            if is_prime(k):
                c.append(k)
        if a%i == 0:
            if is_prime(i):
                c.append(i)
print((len(set(c))+1))
# Original solution
def is_prime(num):
    if num<2:
        return False
    if num==2 or num==3:
        return True
    for i in range(2,int(num**0.5)+1):
        if num%i==0:
            return False
    return True
 
def main():
    a,b=list(map(int,input().split()))
    s,l=min(a,b),max(a,b)
    #sの約数のうち、素数を求める。
    s_sub=s
    #s_prime=[1]
    i=2
    ans=1
    while i<=s_sub:
        if s%i==0:
            if is_prime(i):
                if l%(i)==0:
                    ans+=1
                #s_prime.append(i)
                if is_prime(s//i):
                    if l%(s//i)==0:
                        ans+=1
                s_sub=s//i-1
        i+=1
        
    print(ans)
    
main()

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

def is_prime(num):
    if num<1:
        return False
    if num==1 or num==2 or num==3:
        return True
    for i in range(2,int(num**0.5)+1):
        if num%i==0:
            return False
    return True
 
def main():
    a,b=list(map(int,input().split()))
    GCD=gcd(a,b)
    ans=0
    for i in range(1,int(GCD**0.5)+1):
        if GCD%i==0:
            if is_prime(i):
                ans+=1
            if i!=GCD and is_prime(GCD//i):
                ans+=1
    print(ans)
    
main()
# Original solution
def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return a

def is_prime(n):
    if n == 1:
        return False
    for i in range(2, int(n**(1/2)) + 1):
        if n%i == 0:
            return False
    return True

def factors(N): #約数を全て求める。ただし、順不同
    from collections import deque
    ret = 0
    middle = int( N**(1/2))
    for i in range(1, middle):
        if N%i == 0:
            if is_prime(i):
                ret += 1
            if is_prime(N//i):
                ret += 1
            
    if N%middle == 0:
        if is_prime(middle):
            ret += 1
        if middle != N//middle:
            if is_prime(N//middle):
                ret += 1
    return ret

    
def main():
    a, b = list(map( int, input().split()))
    d = gcd(a,b)
#    print(2, is_prime(2))
    if d == 1:
        print((1))
        return
    if is_prime(d):
        print((2))
        return

    print((factors(d)+1))

if __name__ == '__main__':
    main()

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

def factors(N): #約数を全て求める。ただし、順不同
    ret = 1
    middle = int( N**(1/2))
    tmp = N
    # if tmp%2 == 0:
    #     while tmp%2 == 0:
    #         tmp //= 2
    for i in range(2, middle+1):
        if tmp%i == 0:
            ret += 1
            while tmp%i == 0:
                tmp //= i
    if tmp != 1:
        ret += 1
    return ret

    
def main():
    a, b = list(map( int, input().split()))
    d = gcd(a,b)
#    print(2, is_prime(2))
    if d == 1:
        print((1))
        return

    print((factors(d)))

if __name__ == '__main__':
    main()
# Original solution
import math

A,B=list(map(int,input().split()))
min=min(A,B)
rng=math.ceil(math.sqrt(min))
divisor=[1]
stack=[]
for i in range(2,min+1):
    if A%i==0 and B%i==0:
        p=min//i
        stack.append(p)
        for x in divisor:
            if i%x==0 and x!=1:
                break
        else:
            divisor+=[i]

while len(stack)!=0:
    p=stack.pop()
    if A%p==0 and B%p==0:
        for x in divisor:
            if p%x==0 and x!=1:
                break
        else:
            divisor+=[p]

print((len(divisor)))


# Optimized solution
import math

divisor=[1]
stack=[]
#eiclidean algorithm
A,B=list(map(int,input().split()))
p=max(A,B)
q=min(A,B)
int2=0
gcd=0
while True:
    int2=p%q
    if int2==0:
        gcd=q
        break
    else:
        p=q
        q=int2

if gcd!=1:
    stack.append(gcd)
    
for i in range(2,math.ceil(math.sqrt(gcd))+1):
    if gcd%i==0:
        p=gcd//i
        stack.append(p)
        for x in divisor:
            if i%x==0 and x!=1:
                break
        else:
            divisor+=[i]

while len(stack)!=0:
    p=stack.pop()
    for x in divisor:
        if p%x==0 and x!=1:
            break
    else:
        divisor+=[p]


print((len(divisor)))
# Original solution
import math

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


ans = 1
sosuu = [2]
A = min(a,b)+1
for L in range(3, A, 2): # 2 以外の素数は奇数なので
    for L2 in sosuu:
        if L % L2 == 0:
            break # 素数でないことがわかったらそれ以上ループする必要はない
    else: # break で抜けることがなかったら L は素数（Python 特有の制御構文）
        sosuu.append(L)
        if a%L==0 and b%L==0:
            ans += 1

if a%2==0 and b%2==0:
    ans += 1
print(ans)

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

if min(a,b) == 1:
    print((1))
    exit()

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

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


def input(): return sys.stdin.readline().strip()
def I(): return int(eval(input()))
def LI(): return list(map(int, input().split()))


# a, bの公約数の集合 と a, bの最大公約数の約数の集合 は同値
# a, bの最大公約数の約数のうち、互いに素なもの <= a, bの最大公約数の素因数と(と 1)
# n の素因数分解はO(√ n)で行える


def get_primes(n):
    root_n = int(n ** 0.5)
    is_prime = [True] * (n + 1)
    is_prime[0], is_prime[1] = False, False
    for i in range(2, root_n + 1):
        if not is_prime[i]:
            continue
        # i の倍数の素数判定をFalseにする
        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]]


def prime_factrize(n: int) -> list:
    # 素因数のリストを取得(重複する素因数を含む)
    # 例 : 18 -> [2, 3, 3]
    if n < 2:
        return []
    p_factors = []
    # 2だけ先に取り分けておく
    while n % 2 == 0:
        p_factors.append(2)
        n //= 2
    # 残りの奇数の素因数を探す
    f = 3
    while f * f <= n:
        if n % f == 0:
            p_factors.append(f)
            n //= f
        else:
            f += 2
    # nが素数の場合
    if n != 1:
        p_factors.append(n)
    return p_factors


def main():
    a, b = LI()
    gcd = math.gcd(a, b)
    pf = prime_factrize(gcd)
    pf = set(pf)  # 素因数だけ取り出す
    # 1 を加える
    pf.add(1)
    print((len(pf)))


main()


# Optimized solution
import math
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(eval(input()))
def LI(): return list(map(int, input().split()))


# a, bの公約数の集合 と a, bの最大公約数の約数の集合 は同値
# a, bの最大公約数の約数のうち、互いに素なもの <= a, bの最大公約数の素因数と(と 1)
# n の素因数分解はO(√ n)で行える

# ↑の方法とは異なる解法
def prime_factrize(n: int) -> list:
    # 素因数のリストを取得(重複する素因数を含む)
    # 例 : 18 -> [2, 3, 3]
    if n < 2:
        return []
    p_factors = []
    # 2だけ先に取り分けておく
    while n % 2 == 0:
        p_factors.append(2)
        n //= 2
    # 残りの奇数の素因数を探す
    f = 3
    while f * f <= n:
        if n % f == 0:
            p_factors.append(f)
            n //= f
        else:
            f += 2
    # nが素数の場合
    if n != 1:
        p_factors.append(n)
    return p_factors


def main():
    a, b = LI()
    gcd = math.gcd(a, b)
    pf = prime_factrize(gcd)
    pf = set(pf)  # 素因数だけ取り出す
    # 1 を加える
    pf.add(1)
    print((len(pf)))


main()
# Original solution
def gcd(a,b):
    if a<b: a,b=b,a
    while b: a,b = b, a%b
    return a
def main():
  a, b = list(map(int, input().split()))
  c = gcd(a, b)
  ans = 1
  i = 2
  while c!=1:
    if c%i==0: ans+=1
    while c%i==0: c//=i
    i+=1
  print(ans)
if __name__=="__main__":main()

# Optimized solution
def prefactor(x):
  ret = set()
  for i in range(2, int(x**0.5)+1):
    if x%i==0: ret.add(i)
    while x%i==0: x //= i
  if x>1: ret.add(x)
  return ret
    

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

def get_sieve_of_eratosthenes(n):
    prime = [1, 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]

def get_gcd(a, b):
    if b > a:
        a, b = b, a
    r = a%b
    if r == 0:
        return b
    else:
        return get_gcd(b, r)

A, B = list(map(int, input().split()))
gcd = get_gcd(A, B)
if gcd == 1:
  print("1")
else:
  primes = get_sieve_of_eratosthenes(gcd)
  divisors = [p for p in primes if gcd%p==0]
  print((len(divisors)))

# Optimized solution
def get_gcd(a, b):
    if b > a:
        a, b = b, a
    r = a%b
    if r == 0:
        return b
    else:
        return get_gcd(b, r)


def prime_factorize(n):
    answers = []
    while n % 2 == 0:
        answers.append(2)
        n //= 2
    f = 3
    while f**2 <= n:  # instead of f <= n**0.5
        if n % f == 0:
            answers.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        answers.append(n)
    return answers

A, B = list(map(int, input().split()))
gcd = get_gcd(A, B)
factors = prime_factorize(gcd)
print((len(set(factors+[1]))))
# Original solution
a, b = list(map(int, input().split()))
cnt = 1
i = 2
c, d = a, b

while d > 0:
    c, d = d, c % d

while c > 1:
    if c % i == 0:
        cnt += 1
        
        while c % i == 0:
            c //= i

    i += 1

print(cnt)

# Optimized solution
import math

a, b = list(map(int, input().split()))
cnt = 1
i = 2
c, d = a, b

while d > 0:
    c, d = d, c % d

k = int(math.sqrt(c))

while c > 1:
    if c % i == 0:
        cnt += 1
        
        while c % i == 0:
            c //= i

    i += 1

    if k < i:
        cnt += 1
        break

print(cnt)
# Original solution
import math


def cf(x, y):
    table = [1]
    for i in range(2, min(x, y) + 1):
        if x % i == 0 and y % i == 0:
            table.append(i)
    return table


def primes(n):
    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]]


def is_pn(x):
    if x == 2:
        return 1
    if x % 2 == 0:
        return 0
    m = math.floor(math.sqrt(x))
    for p in pn_list:
        if x % p == 0:
            return 0
        if p > m:
            break
    return 1


A, B = list(map(int, input().split()))
table = cf(A, B)
pn_list = primes(table[-1])
ans = 0
for i in table:
    ans += is_pn(i)
print(ans)

# Optimized solution
def prime_factorize(n):
    table = [1]
    while n % 2 == 0:
        table.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            table.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        table.append(n)
    return table


A, B = list(map(int, input().split()))
a = set(prime_factorize(A))
b = set(prime_factorize(B))
ans = 0
for ap in a:
    if ap in b:
        ans += 1
print(ans)
# Original solution
def main():
    N, M = (int(i) for i in input().split())

    def enum_divisors(n):
        # 約数列挙
        divs = set()
        for i in range(1, n+1):
            if i*i > n:
                break
            if n % i == 0:
                divs.add(i)
                if n//i != i:
                    # i が平方数でない
                    divs.add(n//i)
        return divs

    divs = enum_divisors(N) & enum_divisors(M)
    ans = 1
    v = 1
    from math import gcd
    for s in sorted(divs):
        if s == 1:
            continue
        if gcd(v, s) == 1:
            v *= s
            ans += 1
    print(ans)


if __name__ == '__main__':
    main()


# Optimized solution
def main():
    N, M = (int(i) for i in input().split())

    def prime_factorize(n):
        res = []
        for i in range(2, n+1):
            if i*i > n:
                break
            if n % i != 0:
                continue
            ex = 0
            while n % i == 0:
                ex += 1
                n //= i
            res.append((i, ex))
        if n != 1:
            res.append((n, 1))
        return res

    from math import gcd
    g = gcd(N, M)
    pf = prime_factorize(g)

    ans = 1 + len(pf)

    print(ans)


if __name__ == '__main__':
    main()
# Original solution
import math

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

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

	return gcd(b, a%b)


G = gcd(A,B)

sosu = [1]
#d = math.ceil(G**(1/2))
flg = [i for i in range(1, G+1)]


for i in range(2,G+1):
	if flg[i-1] == 0:
		continue
	if G % i == 0:
		sosu.append(i)
		ind = i
		while ind <= G:
			flg[ind-1] = 0
			ind += i


print((len(sosu)))

# Optimized solution
import math

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

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

	return gcd(b, a%b)


G = gcd(A,B)


def sosuhantei(n):
	d = math.floor(n**(1/2))
	cond = True
	for i in range(2,d+1):
		if n % i == 0:
			cond = False
			break
	return cond 


sosu = []
g = math.ceil(G**(1/2)) 

yaku = []

for i in range(1,g+1):
	if G % i == 0:
		yaku.append(i)
		yaku.append(G//i)

yaku = list(set(yaku))

cnt = 0
for i in range(len(yaku)):
	if sosuhantei(yaku[i]):
		cnt += 1

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

def gcd(x, y):
    while y != 0:
        x, y = y, x % y
    return x


def prime_factorize(x):
    res = []
    i = 2
    while i * i <= x:
        if x % i:
            continue
        res.append([i, 0])
        while x % i == 0:
            x //= i
            res[-1][1] += 1
        i += 1
    if x != 1:
        res.append([x, 1])
    return res


cd = gcd(A, B)
ans = len(prime_factorize(cd)) + 1
print(ans)


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

    def gcd(x, y):
        while y != 0:
            x, y = y, x % y
        return x

    def prime_factorize(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])


        return arr

    cd = gcd(A, B)
    ans = len(prime_factorize(cd)) + 1
    print(ans)


if __name__ == "__main__":
    main()
# Original solution
import math
def pri(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
ans = 0
a,b = list(map(int,input().split()))
for i in range(1,int(min(a,b)**0.5)+1):
    if i in pri(a) and i in pri(b):
        ans += 1
print((ans+1))

# Optimized solution
import math
def main():
    def pri(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
    ans = 0
    a,b = list(map(int,input().split()))
    c = pri(a)
    d = pri(b)
    p = []
    if len(c) > 0:
        p.append(c[0])
    for i in range(len(c)-1):
        if c[i] != c[i+1]:
            p.append(c[i+1])
    for i in range(len(p)):
        if p[i] in d:
            ans += 1
    print((ans+1))
if __name__ == '__main__':
    main()
# Original solution
A, B = list(int(el) for el in input().split(' '))

set_a=set()
set_b=set()

set_a.add(1)
set_b.add(1)

num=2

while True:
  if A%num == 0:
    A=A//num
    if num not in set_a: set_a.add(num)
  else:
    num+=1
    
  if num >= A+1: break
    
num=2
while True:
  if B%num == 0:
    B=B//num
    if num not in set_b: set_b.add(num)
  else:
    num+=1
    
  if num >= B+1: break

print((len(set_a & set_b)))

# Optimized solution
A, B = list(int(el) for el in input().split(' '))


if (A==1) or (B==1): 
  print((1)) 
  is_print=False
else:
  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

  fact_a = factorization(A)
  fact_b = factorization(B)

  set_a = set()
  set_b = set()

  set_a.add(1)
  set_b.add(1)

  for fa, _ in fact_a: set_a.add(fa)
  for fb, _ in fact_b: set_b.add(fb)


  print((len(set_a & set_b)))
# Original solution
#!/usr/bin/env python
# -*- coding: utf-8 -*-


# 最大公約数
def gcd(a, b):
  while b != 0:
    a, b = b, a % b

  return a


# 素因数分解
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


def main():
  a, b = list(map(int, input().split()))
  g = gcd(a, b)
  fs = [v for v, _ in factorization(g) if v != 1]
  print((len(fs) + 1))


if __name__ == '__main__':
  main()


# Optimized solution
#!/usr/bin/env python
# -*- coding: utf-8 -*-


# 最大公約数
def gcd(a, b):
  while b != 0:
    a, b = b, a % b

  return a


# 素因数分解
def primes(v):
  ps = []

  for i in range(2, int(v ** 0.5) + 1):
    if i ** 2 > v:
      break

    if v % i == 0:
      ps.append([i, 1])
      v //= i

      while v % i == 0:
        ps[-1][1] += 1
        v //= i

  if v > 1:
    ps.append([v, 1])

  return ps


def main():
  a, b = list(map(int, input().split()))
  g = gcd(a, b)
  print((len(primes(g)) + 1))


if __name__ == '__main__':
  main()
# Original solution
import math,sys
sys.setrecursionlimit(1000000)
def mygcd(x,y):
    if x<y:x,y=y,x
    if y==0:return x
    return mygcd(y,x%y)
def is_prime(n):
    if n==1:return True
    for i in range(2,int(math.sqrt(n))+1):
        if n%i==0:return False
    return True
A,B = list(map(int,input().split()))
gcd = mygcd(A,B)
C = []
for i in range(1,gcd+1):
    if i*i>gcd:break
    if gcd%i==0:
        C.append(i)
        if i!=gcd//i:
            C.append(gcd//i)
cnt = 0
for c in C:
    if is_prime(c):cnt+=1
print(cnt)

# Optimized solution
A,B = list(map(int,input().split()))
def gcd(x,y):
    if x<y:x,y = y,x
    if y==0:return x
    return gcd(y,x%y)
G = gcd(A,B)
S = set()
S.add(1)
n = G
for i in range(2,G+1):
    if i*i>n:
        S.add(n)
        break
    if n%i==0:
        S.add(i)
    while n%i==0:
        n//=i
print((len(S)))
# Original solution
import math

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

def soinsu(test):
    list_sosu = []
    x = 0
    while x==0:
        for i in range(2,test+1):
            if test % i == 0:
                test = int(test/i)
                if test == 1:
                    x = 1
                list_sosu.append(i)
                break
    return set(list_sosu)

if A == 1 or B == 1:
    print((1))
    
else:
    print((len(soinsu(A)&soinsu(B))+1))

# Optimized solution
import math

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

def soinsu(test):
    list_sosu = []
    x = 0
    while x==0:
        for i in range(2,test+1):
            if i > int(math.sqrt(test)):
                list_sosu.append(test)
                x = 1
                break
            elif test % i == 0:
                test = int(test/i)
                if test == 1:
                    x = 1
                list_sosu.append(i)
                break
    return set(list_sosu)

if A == 1 or B == 1:
    print((1))
    
else:
    print((len(soinsu(A)&soinsu(B))+1))
# Original solution
import math

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

def divisor(x):
    divs = []
    for i in range(1, math.floor(math.sqrt(x))+1):
        if x%i == 0:
            divs.append(i)
            if i**2 != x:
                divs.append(x//i)
    return divs

codiv = set(divisor(A)) & set(divisor(B))

for i in codiv:
    if len(divisor(i)) <= 2:
        count += 1

print(count)


# Optimized solution
import math

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

def divisor(x):
    divs = []
    for i in range(1, math.floor(math.sqrt(x))+1):
        if x%i == 0:
            divs.append(i)
            if i**2 != x:
                divs.append(x//i)
    return divs

def evPrimal(x):
    if x < 4:
        return True
    divs = []
    for i in range(2, math.floor(math.sqrt(x))+1):
        if x%i == 0:
            return False
    return True

codiv = set(divisor(A)) & set(divisor(B))

for i in codiv:
    if evPrimal(i):
        count += 1

print(count)