qyliang/CodeNanoFix huggingface dataset:
# Buggy code:
import math
a,b=map(int,input().split())
gcd=math.gcd(a,b)

def prime_factorization(n):
  i=2
  prime=[]
  if n%i:
    i+=1
  else:
    n//=i
    prime.append(2)
    while n%i==0:
      n//=i
  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)

# Fixed code:
import math
a,b=map(int,input().split())
gcd=math.gcd(a,b)

def prime_factorization(n):
  i=2
  prime=[]
  while i*i<=n:
    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))
# Buggy code:
A, B = map(int,input().split())
def gcd(a,b):
    if a < b:
        a,b = b,a
    if b == 0: return a
    r = a % b
    return gcd(b,r)

L = [1]

g = gcd(A, B)
i = 2
while g > 1:
    if i > g ** (1/2): break
    if g % i == 0:
        if L[-1] != i:
            L.append(i)
        g /= i
    else:
        i += 1
print(len(L))


# Fixed code:
A, B = map(int,input().split())
def gcd(a,b):
    if a < b:
        a,b = b,a
    if b == 0: return a
    r = a % b
    return gcd(b,r)

L = [1]

g = gcd(A, B)
g_copy = gcd(A, B)
i = 2
while g > 1:
    if i > g_copy ** (1/2) :
        if g != 1:
            L.append(i)
        break
    if g % i == 0:
        if L[-1] != i:
            L.append(i)
        g /= i
    else:
        i += 1
print(len(L))
# Buggy code:
import math
def gcd(a, b):
    if a > b:
        a, b = b, a
    if a == 0:
        return b
    else:
        return gcd(a, b % a)

# N = int(input())
A, B = [int(_) for _ in input().split()]

gcd_ab = gcd(A, B)
cds = []
for k in range(1, math.ceil(math.sqrt(gcd_ab) + 1)):
    if gcd_ab % k == 0:
        cds.append(k)
        cds.append(gcd_ab // k)

ans = []
for cd in cds[1:]:
    for a in ans:
        if cd % a == 0:
            break
    else:
        ans.append(cd)

print(len(ans) + 1)


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

# N = int(input())
A, B = [int(_) for _ in input().split()]

gcd_ab = gcd(A, B)
cds = []
for k in range(1, math.ceil(math.sqrt(gcd_ab)) + 1):
    if gcd_ab % k == 0:
        cds.append(k)
        cds.append(gcd_ab // k)
cds = list(set(cds))
cds.sort()

ans = []
for cd in cds[1:]:
    for a in ans:
        if cd % a == 0:
            break
    else:
        ans.append(cd)

print(len(ans) + 1)
# Buggy code:
def gcd(x, y):
    while y != 0:
        x, y = y, x % y
    return x


def prime_factor(n):
    ret, p = [], 2

    while p*p <= n:
        if n % p != 0:
            p += 1
            continue

        exp_v = 0
        while n%p == 0:
            exp += 1
            n //= p
        ret.append( [ret, exp_v] )

        p += 1

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

    return ret


a, b = map(int, input().split())
g = gcd(a, b)

print( len(prime_factor(g)) + 1)

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


def prime_factor(n):
    ret, p = [], 2

    while p*p <= n:
        if n % p != 0:
            p += 1
            continue

        exp = 0
        while n%p == 0:
            exp += 1
            n //= p
        ret.append( [ret, exp] )

        p += 1

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

    return ret


a, b = map(int, input().split())
g = gcd(a, b)

print( len(prime_factor(g)) + 1)
# Buggy code:
# -*- coding: utf-8 -*-
from math import sqrt
import sys
#input = sys.stdin.readline
def inpl(): return list(map(int, input().split()))
A, B = inpl()
A = B = (10**9 + 7)*6

def primes(N):
    sieve = [1]*(N+1)
    sieve[:2] = [0, 0]
    P = []
    for i in range(2, N+1):
        if sieve[i]:
            P.append(i)
            for j in range(2*i, N+1, i):
                sieve[j] = 0
    return P

P = primes(10**6)

ans = 1

ext = []

ais = True
bis = True

S = min(A, B)
for p in P:
    if p > min(A, B):
        break
    ans += int(A%p == B%p == 0)
    while A%p == 0:
        A //= p
    while B%p == 0:
        B //= p
else:
    if A > 1:
        ans += int(B%A == 0)
    elif B > 1:
        ans += int(A%B == 0)

print(ans)

# Fixed code:
# -*- coding: utf-8 -*-
from math import sqrt
import sys
#input = sys.stdin.readline
def inpl(): return list(map(int, input().split()))
A, B = inpl()

def primes(N):
    sieve = [1]*(N+1)
    sieve[:2] = [0, 0]
    P = []
    for i in range(2, N+1):
        if sieve[i]:
            P.append(i)
            for j in range(2*i, N+1, i):
                sieve[j] = 0
    return P

P = primes(10**6)

ans = 1

ext = []

ais = True
bis = True

S = min(A, B)
for p in P:
    if p > min(A, B):
        break
    ans += int(A%p == B%p == 0)
    while A%p == 0:
        A //= p
    while B%p == 0:
        B //= p
else:
    if A > 1:
        ans += int(B%A == 0)
    elif B > 1:
        ans += int(A%B == 0)

print(ans)
# Buggy code:
A, B = map(int, input().split())

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

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


gcd = GCD(A, B)
divs = prime_decomposition(gcd)

print(1 + len(divs))

# Fixed code:
A, B = map(int, input().split())

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

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


gcd = GCD(A, B)
divs = prime_decomposition(gcd)
print(1 + len(divs))
# Buggy code:
# coding: utf-8
import sys
#from operator import itemgetter
sysread = sys.stdin.buffer.readline
read = sys.stdin.buffer.read
#from heapq import heappop, heappush
#from collections import defaultdict
sys.setrecursionlimit(10**7)
import math
from itertools import product, accumulate, combinations, product
#import bisect# lower_bound etc
#import numpy as np
#from copy import deepcopy
#from collections import deque

def run():
    A,B = map(int, sysread().split())
    K = math.gcd(A,B)
    factorials = []
    for i in range(2, 10 ** 6):
        done = False
        limit = int(i ** 0.5)
        for j in factorials:
            if j > limit:break
            if not i % j:
                done = True
                break
        if not done:
            factorials.append(i)

    factors = []
    for f in factorials:
        if not K % f:
            factors.append(f)
    if factors:
        print(len(factors)+ 1)
    else:
        print(2)


    #print(factorials)
if __name__ == "__main__":
    run()

# Fixed code:
# coding: utf-8
import sys
#from operator import itemgetter
sysread = sys.stdin.buffer.readline
read = sys.stdin.buffer.read
#from heapq import heappop, heappush
#from collections import defaultdict
sys.setrecursionlimit(10**7)
import math
from itertools import product, accumulate, combinations, product
#import bisect# lower_bound etc
#import numpy as np
#from copy import deepcopy
#from collections import deque

def run():
    A,B = map(int, sysread().split())
    K = math.gcd(A,B)
    factorials = []
    L = int(max(A,B)**0.5)
    for i in range(2, L+1):
        done = False
        limit = int(i ** 0.5)
        for j in factorials:
            if j > limit:break
            if not i % j:
                done = True
                break
        if not done:
            factorials.append(i)

    factors = [1]
    for f in factorials:
        if f > K:break
        if not K % f:
            factors.append(f)
            while not K % f:
                K = K // f

    if K != 1:
        factors.append(K)
    print(len(factors))


    #print(factorials)
if __name__ == "__main__":
    run()
# Buggy code:
def divisor(n):
    i = 1
    table = []

    while i * i <= n:
        if n % i == 0:
            table.append(i)
            table.append(n // i)
        i += 1
    table = list(set(table))

    return table


def common_divisor(a, b):
    table = []
    for i in a:
        if i in b:
            table.append(i)
    return table


def resolve():
    A, B = map(int, input().split())
    a_list = divisor(A)
    b_list = divisor(B)
    common_list = common_divisor(a_list, b_list) if len(a_list) < len(b_list) else common_divisor(b_list, a_list)
    common_list.sort()
    print(common_list)
    i = 1
    while i < len(common_list):
        j = i + 1
        while j < len(common_list):
            if common_list[j] % common_list[i] == 0:
                del common_list[j]
            else:
                j += 1
        i += 1

    print(len(common_list))
    
resolve()


# Fixed code:
def divisor(n):
    i = 1
    table = []

    while i * i <= n:
        if n % i == 0:
            table.append(i)
            table.append(n // i)
        i += 1
    table = list(set(table))

    return table


def common_divisor(a, b):
    table = []
    for i in a:
        if i in b:
            table.append(i)
    return table


def resolve():
    A, B = map(int, input().split())
    a_list = divisor(A)
    b_list = divisor(B)
    common_list = common_divisor(a_list, b_list) if len(a_list) < len(b_list) else common_divisor(b_list, a_list)
    common_list.sort()
    i = 1
    while i < len(common_list):
        j = i + 1
        while j < len(common_list):
            if common_list[j] % common_list[i] == 0:
                del common_list[j]
            else:
                j += 1
        i += 1

    print(len(common_list))
    
resolve()
# Buggy code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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

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

def divisor(a, b):
    if a < b:
        b, a = a, b
    res = []
    ra = int(a**0.5) + 1 
    for i in range(1, ra):
        if a % i == 0:
            if b % i == 0:
                res.append(i)
                if i != a / i and b % (a/i) == 0:
                    res.append(int(a / i))
            else:
                if i != a / i and b % (a/i) == 0:
                    res.append(int(a / i))
    return sorted(res)

Y = divisor(A, B)
print(Y)
ans = 0
for i in range(len(Y)):
    if is_prime(Y[i]):
        ans += 1

print(ans)

# Fixed code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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

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

def divisor(a, b):
    if a < b:
        b, a = a, b
    res = []
    ra = int(a**0.5) + 1 
    for i in range(1, ra):
        if a % i == 0:
            if b % i == 0:
                res.append(i)
                if i != a / i and b % (a/i) == 0:
                    res.append(int(a / i))
            else:
                if i != a / i and b % (a/i) == 0:
                    res.append(int(a / i))
    return sorted(res)

Y = divisor(A, B)

ans = 0
for i in range(len(Y)):
    if is_prime(Y[i]):
        ans += 1

print(ans)
# Buggy code:
import math

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

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True

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, B = map(int, input().split())
div1 = make_divisors(A)
print(div1)
div2 = make_divisors(B)
nums = list(set(div1).intersection(set(div2)))
print(nums)
nums = [x for x in nums if is_prime(x)]
print(nums)
cnt = len(nums)
if cnt > 1:
    print(cnt * (cnt - 1) // 2)
else:
    print(1)

# Fixed code:
import math

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

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True

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, B = map(int, input().split())
div1 = make_divisors(A)
# print(div1)
div2 = make_divisors(B)
nums = list(set(div1).intersection(set(div2)))
# print(nums)
nums = [x for x in nums if is_prime(x)]
# print(nums)
cnt = len(nums)
if cnt > 1:
    print(cnt)
else:
    print(1)
# Buggy code:
from collections import defaultdict


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


def prime_factorization(n):
    factors = defaultdict(int)
    i = 1
    n_sub = n
    while True:
        i += 1
        if i * i > n or n_sub == 1:
            break

        while n_sub % i == 0:
            n_sub = n_sub // i
            factors[i] += 1

    if len(factors) == 0:
        factors[n] = 1
    return factors


def main():
    a, b = map(int, input().split())
    g = gcd(a, b)
    if g == 1:
        return 1
    primes = prime_factorization(g)
    # add "1"
    return len(primes) + 1
    

print(main())


# Fixed code:
from collections import defaultdict


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


def prime_factorization(n):
    factors = defaultdict(int)
    i = 1
    n_sub = n
    while True:
        i += 1
        if i * i > n or n_sub == 1:
            break

        while n_sub % i == 0:
            n_sub = n_sub // i
            factors[i] += 1

    if n_sub != 1:
        factors[n_sub] = 1
    return factors


def main():
    a, b = map(int, input().split())
    g = gcd(a, b)
    if g == 1:
        return 1
    primes = prime_factorization(g)
    # add "1"
    return len(primes) + 1
    

print(main())
# Buggy code:
A,B = 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
lis = list(factorization(A))
counter = 0
for i in range(len(lis)):
  jud = B/lis[i][0]
  if jud.is_integer():
    counter += 1
print(counter+1)

# Fixed code:
A,B = 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
lis = list(factorization(A))
counter = 0
for i in range(len(lis)):
  jud = B/lis[i][0]
  if jud.is_integer():
    counter += 1
if A == 1 or B == 1:
  print(1)
else:
  print(counter+1)
# Buggy code:
def make_divisors(n):
    divisors = []
    for i in range(1, n//2+1):
        if n % i == 0:
            divisors.append(i)
 
    divisors.sort()
    return divisors
 
 
A, B = map(int, input().split())
divided_1 = min(A, B)
divided_2 = max(A, B)
 
divisors = make_divisors(divided_1)
cd = []
for d in divisors:
  if divided_2 % d == 0:
    cd.append(d)
 
res = []
for e in cd:
  flg = True
  for i in range(1, len(res)):
    r = res[i]
    if e % r == 0:
      flg = False
      break
  if flg:
    res.append(e)
 
print(len(res))

# Fixed code:
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, B = map(int, input().split())
divided_1 = min(A, B)
divided_2 = max(A, B)

divisors = make_divisors(divided_1)
cd = []
for d in divisors:
  if divided_2 % d == 0:
    cd.append(d)

res = []
for e in cd:
  flg = True
  for i in range(1, len(res)):
    r = res[i]
    if e % r == 0:
      flg = False
      break
  if flg:
    res.append(e)

print(len(res))
# Buggy code:
import fractions
import math

def trial_division(n):
    a = []
    for i in range(2,int(math.sqrt(n)) + 1):
        while n % i == 0:
            n //= i
            a.append(i)
    a.append(n)
    return a


A, B = map(int, input().split())
max_n = fractions.gcd(A,B)

ans = set(trial_division(max_n))

print(len(ans))

# Fixed code:
import math
def trial_division(n):
    a = [1]
    for i in range(2,int(math.sqrt(n)) + 1):
        while n % i == 0:
            n //= i
            a.append(i)
    a.append(n)
    return a
A, B = map(int, input().split())
ans = set(trial_division(A)) & set(trial_division(B))
print(len(ans))
# Buggy code:
import sys
sys.setrecursionlimit(12345678)
import itertools
from collections import Counter
from collections import defaultdict
from collections import deque
import bisect
from heapq import heappush, heappop


def primes(n):
    pl = [1]
    if n == 2:
        pl.append(2)
        return pl
    if n == 3:
        pl.append(3)
        return pl

    i = 2
    while i * i <= n:
        if n % i == 0:
            pl.append(i)
            while n % i == 0:
                n //= i
        i += 1
    return pl


def main():
    a, b = map(int, input().split())
    ap = set(primes(a))
    bp = set(primes(b))
    # print(ap)
    # print(bp)
    print(len(ap & bp))


if __name__ == '__main__':
    main()


# Fixed code:
import sys
sys.setrecursionlimit(12345678)
import itertools
from collections import Counter
from collections import defaultdict
from collections import deque
import bisect
from heapq import heappush, heappop


def primes(n):
    pl = [1]
    if n == 2:
        pl.append(2)
        return pl
    if n == 3:
        pl.append(3)
        return pl

    i = 2
    while i * i <= n:
        if n % i == 0:
            pl.append(i)
            while n % i == 0:
                n //= i
        i += 1
    if n > 1:
        pl.append(n)
    return pl


def main():
    a, b = map(int, input().split())
    ap = set(primes(a))
    bp = set(primes(b))
    # print(ap)
    # print(bp)
    # print(ap & bp)
    print(len(ap & bp))


if __name__ == '__main__':
    main()
# Buggy code:
def trial_division(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 = (lambda x: (min(x),max(x)))(list(map(int,input().split())))
print(len(set(trial_division(A),trial_division(B)))+1)

# Fixed code:
def trial_division(n,b):
    a = []
    if n%2==0 and b%2==0:
        a.append(2)
    while n % 2 == 0:
        n /= 2
    f = 3
    while f*f <= n:
        if n % f == 0: 
            if b%f == 0:
                a.append(f)
            n /= f
        else:
            f += 2   
    if n != 1 and b%n==0: 
        a.append(n)
    return a
A,B = (lambda x: (min(x),max(x)))(list(map(int,input().split())))
print(len(set(trial_division(A,B)))+1)
# Buggy code:
def gcd(a,b):
  while b:
    a,b=b,a%b
  return a
a,b=map(int,input().split())
g=gcd(a,b)

c=1
for i in range(2,10**6+1):
  if g%i==0:
    c+=1
    while g%i==0:
      g//=i
if g:
  c+=1
print(c)

# Fixed code:
def gcd(a,b):
  while b:
    a,b=b,a%b
  return a
a,b=map(int,input().split())
g=gcd(a,b)

c=1
for i in range(2,10**6+1):
  if g%i==0:
    c+=1
    while g%i==0:
      g//=i
if g!=1:
  c+=1
print(c)
# Buggy code:
import math

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

def func(n):
    num=1
    for i in range(2,int(math.sqrt(n) + 1e-9) +3):
        if n%i==0 and n!=i:
            num=0
            break
        else:
            continue
    return num

p=min(A,B)
q=max(A,B)

ans=0
check=[]
for i in range(1, int(math.sqrt(p)+ 1e-9)+3):
    if p%i==0:
        check.append(i)
        check.append(p/i)

for i in check:
    if q%i==0:
        ans+=func(i)

print(ans)

# Fixed code:
import math

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

def func(n):
    num=1
    for i in range(2,int(math.sqrt(n) + 1e-9) +3):
        if n%i==0 and n!=i:
            num=0
            break
        else:
            continue
    return num

p=min(A,B)
q=max(A,B)

ans=0
check=[]
for i in range(1, int(math.sqrt(p)+ 1e-9)+3):
    if p%i==0:
        if i not in check:
            check.append(i)
        if p//i not in check:
            check.append(p//i)

for i in check:
    if q%i==0:
        ans+=func(i)

print(ans)
# Buggy code:
a, b= map(int, input().split())

def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y)
k=gcd(a,b)
if k==1:
  print(1)

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(reverse=True)
    return divisors
m=make_divisors(k)
x=len(m)
n=len(m)



for _ in range(n-1):
  for i in range(1,len(m)):
    if gcd(m[i],m[0])!=1:
      x-=1
      m.pop(0)
      break
    if i+1 == len(m):
      m.pop(0)
      break
print(x)
    

# Fixed code:
a, b= map(int, input().split())

def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y)
k=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(reverse=True)
    return divisors
m=make_divisors(k)
x=len(m)
n=len(m)

for _ in range(n-1):
  for i in range(1,len(m)):
    if gcd(m[i],m[0])!=1:
      x-=1
      m.pop(0)
      break
    if i+1 == len(m):
      m.pop(0)
      break
print(x)
# Buggy code:
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

C=1
A,B=map(int,input().split())
a=factorization(A)
b=factorization(B)
print(len(a))
print(len(b))
for i in range(len(a)):
 a[i][1]=0
for i in range(len(b)):
 b[i][1]=0
for i in range(len(a)):
 if a[i] in b:
  if a[i][0]>1:
   C+=1
print(C)


# Fixed code:
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

C=1
A,B=map(int,input().split())
a=factorization(A)
b=factorization(B)
for i in range(len(a)):
 a[i][1]=0
for i in range(len(b)):
 b[i][1]=0
for i in range(len(a)):
 if a[i] in b:
  if a[i][0]>1:
   C+=1
print(C)
# Buggy code:
import numpy as np
def p(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 = map(int, input().split())
M = np.min([A, B])
a = p(A)
b = p(B)
t = a and b
print(len(t) + 1)


# Fixed code:
import numpy as np
def p(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 = map(int, input().split())
M = np.min([A, B])
a = p(A)
b = p(B)
t = set(a) & set(b)
print(len(t) + 1)