Given are positive integers A and B.
Let us choose some number of positive common divisors of A and B.
Here, any two of the chosen divisors must be coprime.
At most, how many divisors can we choose?Definition of common divisor
An integer d is said to be a common divisor of integers x and y when d divides both x and y.Definition of being coprime
Integers x and y are said to be coprime when x and y have no positive common divisors other than 1.Definition of dividing
An integer x is said to divide another integer y when there exists an integer \alpha such that y = \alpha x.

-----Constraints-----
 - All values in input are integers.
 - 1 \leq A, B \leq 10^{12}

-----Input-----
Input is given from Standard Input in the following format:
A B

-----Output-----
Print the maximum number of divisors that can be chosen to satisfy the condition.

-----Sample Input-----
12 18

-----Sample Output-----
3

12 and 18 have the following positive common divisors: 1, 2, 3, and 6.
1 and 2 are coprime, 2 and 3 are coprime, and 3 and 1 are coprime, so we can choose 1, 2, and 3, which achieve the maximum result.

Difficulty: MEDIUM

Solutions:
(a, b) = map(int, input().split())
while a % b != 0:
	(a, b) = (b, a % b)
ans = 1
if b % 2 == 0:
	ans += 1
	while b % 2 == 0:
		b = b // 2
for i in range(3, int(b ** 0.5) + 1, 2):
	if b % i == 0:
		ans += 1
		while b % i == 0:
			b = b // i
if b != 1:
	ans += 1
print(ans)


from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque, Counter, defaultdict
from operator import mul
import copy
import heapq
sys.setrecursionlimit(10 ** 6)
INF = 10 ** 18
import bisect
import statistics
mod = 10 ** 9 + 7
import numpy
(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
c = math.gcd(A, B)
d = factorization(c)
if c > 1:
	print(len(d) + 1)
else:
	print(1)


import math

def fctr1(n):
	f = []
	c = 0
	r = int(n ** 0.5)
	for i in range(2, r + 2):
		while n % i == 0:
			c += 1
			n = n // i
		if c != 0:
			f.append([i, c])
			c = 0
	if n != 1:
		f.append([n, 1])
	return f
(a, b) = map(int, input().split())
print(len(fctr1(math.gcd(a, b))) + 1)


import math

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

def main():
	(A, B) = [int(x) for x in input().split(' ')]
	g = math.gcd(A, B)
	pg = prime_factorize(g)
	if pg[0][0] == 1:
		print(1)
	else:
		print(len(pg) + 1)
main()


import sys
from io import StringIO
import unittest
import collections

def yn(b):
	print('Yes' if b == 1 else 'No')
	return

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 resolve():
	readline = sys.stdin.readline
	(a, b) = list(map(int, readline().rstrip().split()))
	af = factorization(a)
	bf = factorization(b)
	c = collections.Counter()
	c[1] = 2
	for x in af:
		c[x[0]] += 1
	for x in bf:
		c[x[0]] += 1
	ans = 0
	for k in list(c.keys()):
		if c[k] >= 2:
			ans += 1
	print(ans)
	return
if 'doTest' not in globals():
	resolve()
	return


def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
(a, b) = [int(x) for x in input().split(' ')]
g = gcd(a, b)
ret = 1
i = 2
while i * i <= g:
	if g % i == 0:
		while g % i == 0:
			g /= i
		ret += 1
	i += 1
if g > 1:
	ret += 1
print(ret)


from fractions import *
g = gcd(*map(int, input().split()))
c = 1
for i in range(2, int(g ** 0.5) + 1):
	if g < 2:
		break
	if g % i < 1:
		c += 1
	while g % i < 1:
		g //= i
print(c + (g > 1))


import math

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) = map(int, input().split())
c = math.gcd(a, b)
print(len(set(prime_factorize(c))) + 1)


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

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a
d = gcd(a, b)
pf = {}
for i in range(2, int(d ** 0.5) + 1):
	while d % i == 0:
		pf[i] = pf.get(i, 0) + 1
		d //= i
if d > 1:
	pf[d] = 1
P = list(pf.keys())
print(len(P) + 1)


(a, b) = 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))))


from math import gcd
(a, b) = list(map(int, input().split()))

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]
v = gcd(a, b)
divs = make_divisors(v)
k = 1
ans = 0
for d in divs:
	test = gcd(k, d)
	if test == 1:
		ans += 1
		k *= d
print(ans)


def gcd(m, n):
	while n:
		(m, n) = (n, m % n)
	return m
(a, b) = map(int, input().split())
g = gcd(a, b)
ans = 1
x = 2
while x * x <= g:
	if g % x == 0:
		while g % x == 0:
			g //= x
		ans += 1
	x += 1
if g > 1:
	ans += 1
print(ans)


def main():
	import math
	(a, b) = list(map(int, input().split()))
	g = math.gcd(a, b)
	ans = [1]
	for m in range(2, int(g ** 0.5) + 1):
		if g % m == 0:
			ans.append(m)
			while g % m == 0:
				g = g // m
		if g == 1:
			break
	if g != 1:
		ans.append(g)
	print(len(ans))

def __starting_point():
	main()
__starting_point()


(a, b) = 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)


(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)


def c(n):
	b = 2
	f = set()
	while b * b <= n:
		while n % b == 0:
			n //= b
			f |= {b}
		b += 1
	if n > 1:
		f |= {n}
	return f
(a, b) = map(int, input().split())
print(len(c(a) & c(b)) + 1)


def gcd(a, b):
	while b > 0:
		(a, b) = (b, a % b)
	return a
(a, b) = map(int, input().split())
p = gcd(a, b)
s = {1}
for i in range(2, int(p ** 0.5) + 2):
	if p % i == 0:
		s.add(i)
		p //= i
		while p % i == 0:
			p //= i
if p > 1:
	s.add(p)
print(len(s))


(a, b) = map(int, input().split())
c = 1
for i in range(2, int(max(a ** 0.5, b ** 0.5)) + 2):
	if a % i == 0 == b % i:
		c += 1
	while a % i == 0:
		a //= i
	while b % i == 0:
		b //= i
if a == b != 1:
	c += 1
print(c)


from math import *
from copy import deepcopy
(A, B) = map(int, input().split())
C = gcd(A, B)
E = deepcopy(C)
D = set()
for i in range(2, floor(sqrt(E)) + 1):
	while True:
		if C / i != C / i // 1:
			break
		D.add(i)
		C /= i
if C != 1:
	D.add(int(C))
print(len(D) + 1)


from fractions import *
n = gcd(*map(int, input().split()))
a = 1
i = 2
while i * i <= n:
	a += n % i < 1
	while n % i < 1:
		n //= i
	i += 1
print(a + (n > 1))


(a, b) = map(int, input().split())
g = 1
while 1:
	if a == b:
		g = a
		break
	if a < b:
		k = a
		a = b
		b = k
	a -= b
ans = 1
i = 2
while i * i <= g:
	if g % i == 0:
		ans += 1
		while g % i == 0:
			g //= i
	i += 1
if g != 1:
	ans += 1
print(ans)


import math
(a, b) = 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)


import math
(A, B) = map(int, input().split())
while B > 0:
	(A, B) = (B, A % B)
N = A
ans = 1
for i in [2] + list(range(3, int(math.sqrt(N)) + 2, 2)):
	if N % i == 0:
		while N % i == 0:
			N //= i
		ans += 1
if N > 1:
	ans += 1
print(ans)


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

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
G = gcd(A, B)
ans = 1
d = 2
while d * d <= G:
	if G % d == 0:
		ans += 1
		while G % d == 0:
			G = G // d
	d += 1
if G > 1:
	ans += 1
print(ans)


def gcd(a, b):
	while b != 0:
		(a, b) = (b, a % b)
	return a
(a, b) = map(int, input().split())
g = gcd(a, b)
count = 0
for i in range(2, int(g ** 0.5) + 2):
	if g % i == 0:
		count += 1
		while g % i == 0:
			g //= i
if g != 1:
	count += 1
print(count + 1)


from math import gcd
from typing import List, Tuple

def pf(n: int) -> List[Tuple[int, int]]:
	r = []
	for p in range(2, n):
		if p * p > n:
			break
		e = 0
		if n % p == 0:
			while n % p == 0:
				n //= p
				e += 1
			r.append((p, e))
	if n != 1:
		r.append((n, 1))
	return r
(a, b) = map(int, input().split())
apf = pf(a)
bpf = pf(b)
aps = {p for (p, e) in apf}
bps = {p for (p, e) in bpf}
print(len(aps & bps) + 1)


def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
(a, b) = map(int, input().split())
g = gcd(a, b)
m = g
c = 1
i = 2
while i * i <= g:
	if m % i == 0:
		c += 1
	while m % i == 0:
		m = m // i
	i += 1
if m > 1:
	c += 1
print(c)


import math
(A, B) = map(int, input().split())
x = math.gcd(A, B)

def prime_decomposition(x):
	i = 2
	ls = []
	while i * i <= x:
		while x % i == 0:
			x /= i
			ls.append(i)
		i += 1
	if x > 1:
		ls.append(x)
	return ls
cnt = len(set(prime_decomposition(x)))
print(cnt + 1)


import math

def factorize(n):
	V = [1]
	if n == 1:
		return V
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			V.append(i)
			while n % i == 0:
				n //= i
	if n > 1:
		V.append(n)
	return V
(A, B) = [int(x) for x in input().split()]
V = factorize(math.gcd(A, B))
print(len(V))


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

def prime_d(n):
	i = 2
	t = []
	while i * i <= n:
		while n % i == 0:
			n /= i
			t.append(i)
		i += 1
	if n > 1:
		t.append(n)
	return t
l = set(prime_d(a))
m = set(prime_d(b))
print(len(l & m) + 1)


from math import gcd
(A, B) = map(int, input().split())
d = gcd(A, B)
ans = 1
i = 2
while i <= pow(d, 1 / 2) + 1:
	if d % i == 0:
		ans += 1
		while d % i == 0:
			d //= i
	i += 1
ans += d > 1
print(ans)


from functools import lru_cache

def main():
	(a, b) = map(lambda x: set(prime_factorize(int(x))), input().split())
	print(len(a & b) + 1)

@lru_cache(maxsize=None)
def primes(n: int) -> 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]]

@lru_cache(maxsize=None)
def is_prime(n: int) -> bool:
	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:
	arr = []
	while n % 2 == 0:
		arr.append(2)
		n //= 2
	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]

def __starting_point():
	main()
__starting_point()


def gcd(a, b):
	return gcd(b, a % b) if b else a
(a, b) = 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)


import math

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

def div(n):
	cnt = 0
	temp = n
	for i in range(2, int(math.sqrt(n)) + 1):
		if temp % i == 0:
			while temp % i == 0:
				temp //= i
			cnt += 1
	if temp != 1:
		cnt += 1
	return cnt + 1
(a, b) = map(int, input().split())
print(div(gcd(a, b)))


(x, y) = map(int, input().split())
if x < y:
	(x, y) = (y, x)
while x % y != 0:
	(x, y) = (y, x % y)
ans = 1
for i in range(2, int(y ** 0.5) + 1):
	if y % i == 0:
		ans += 1
		while y % i == 0:
			y //= i
if y > 1:
	ans += 1
print(ans)


import sys
import math
import itertools
import collections
from collections import deque
sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
input = lambda : sys.stdin.readline().strip()
NI = lambda : int(input())
NMI = lambda : map(int, input().split())
NLI = lambda : list(NMI())
SI = lambda : input()

def main():
	(A, B) = NMI()
	GCD = math.gcd(A, B)
	N = GCD
	cnt = 0
	ls = []
	for n in range(2, int(N ** 0.5) + 2):
		if GCD % n == 0:
			cnt += 1
			while GCD % n == 0:
				GCD = GCD // n
				ls.append(n)
	if GCD == 1:
		print(cnt + 1)
	else:
		print(cnt + 2)

def __starting_point():
	main()
__starting_point()


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

def gcd(a, b):
	while b:
		(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
print(len(factorization(gcd(a, b))) + 1 if gcd(a, b) != 1 else 1)


def GCD(x, y):
	if y == 0:
		return x
	return GCD(y, x % y)
(A, B) = map(int, input().split())
g = GCD(A, B)
ans = 1
for i in range(2, int(g ** 0.5) + 1):
	if g % i == 0:
		ans += 1
		while g % i == 0:
			g //= i
if g != 1:
	ans += 1
print(ans)


(N, M) = (int(i) for i in input().split(' '))
(N, M) = (min(M, N), max(M, N))
while M % N != 0:
	M = M % N
	(N, M) = (min(M, N), max(M, N))
i = 2
ans = 0
DN = N
while i * i <= DN:
	if N % i == 0:
		ans += 1
		while N % i == 0:
			N /= i
	i += 1
if i <= N:
	ans += 1
print(ans + 1)


(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_prime = set(prime_factorize(a))
b_prime = set(prime_factorize(b))
ans = 0
for ap in a_prime:
	for bp in b_prime:
		if ap == bp:
			ans += 1
			break
print(ans + 1)


(N, M) = 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 = prime_factorize(N)
b = prime_factorize(M)
c = set(a) & set(b)
print(len(c) + 1)


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

def prime_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)
	if temp != 1:
		arr.append(temp)
	if arr == []:
		arr.append(n)
	return arr
setA = set(prime_factorization(A))
setB = set(prime_factorization(B))
setAB = setA & setB
if setAB == {1}:
	print(1)
else:
	print(len(setAB) + 1)


import math
(a, b) = map(int, input().split())
while b != 0:
	(a, b) = (b, a % b)
c = a
d = []
for i in range(2, int(c ** 0.5) + 2):
	while c % i == 0:
		c //= i
		d.append(i)
if c != 1:
	d.append(c)
print(len(set(d)) + 1)


from math import gcd, sqrt
(a, b) = map(int, input().split())
g = gcd(a, b)
d = {}
for i in range(2, int(sqrt(g)) + 1):
	while g % i == 0:
		g //= i
		d[i] = d.get(i, 0) + 1
if g > 1:
	d[g] = 1
print(len(d) + 1)


import math
(a, b) = map(int, input().split())
x = math.gcd(a, b)
s = [1]
for i in range(2, int(math.sqrt(x) + 1)):
	if x % i == 0:
		while x % i == 0:
			x //= i
		s.append(i)
if x != 1:
	s.append(x)
l = len(s)
print(l)


(a, b) = map(int, input().split())
sa = set()
sb = set()
i = 1
while i * i <= max(a, b):
	if a % i == 0:
		sa.add(i)
		sa.add(a // i)
	if b % i == 0:
		sb.add(i)
		sb.add(b // i)
	i += 1
s = sa & sb
s.remove(1)
for x in list(s):
	for y in list(s):
		if x == y:
			continue
		if y % x == 0:
			s.remove(y)
print(len(s) + 1)


def gcd(a, b):
	while a % b != 0:
		return gcd(b, a % b)
	return b
(A, B) = (int(x) for x in input().split())
Gcd = gcd(A, B)
lo_cds = []
up_cds = []
i = 1
while i * i <= Gcd:
	if Gcd % i == 0:
		lo_cds.append(i)
		if Gcd // i != i:
			up_cds.append(Gcd // i)
	i += 1
Cds = lo_cds + up_cds[::-1]
Cds.pop(0)
i = 0
while i < len(Cds):
	j = i + 1
	while j < len(Cds):
		if Cds[j] % Cds[i] == 0:
			Cds.pop(j)
		else:
			j += 1
	i += 1
print(len(Cds) + 1)


def prime(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) = map(int, input().split())
x = prime(a)
y = prime(b)
print(len(set(x) & set(y)) + 1)


from fractions import *
g = gcd(*map(int, input().split()))
d = {}
i = 2
while i * i <= g:
	if g % i:
		i += 1
	else:
		g //= i
		d[i] = d.get(i, 0) + 1
if g > 1:
	d[g] = d.get(g, 0) + 1
print(len(d) + 1)


import math

def trial_division(n):
	factor = []
	tmp = int(math.sqrt(n)) + 1
	for num in range(2, tmp):
		while n % num == 0:
			n //= num
			factor.append(num)
	if not factor:
		factor.append(1)
		factor.append(n)
		return factor
	else:
		factor.append(1)
		factor.append(n)
		return factor
(A, B) = list(map(int, input().split()))
A_primes = trial_division(A)
B_primes = trial_division(B)
primes = []
for p in A_primes:
	if p in B_primes:
		primes.append(B_primes.pop(B_primes.index(p)))
print(len(list(set(primes))))


import math

def factorization(n):
	arr = [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.append(i)
	if temp != 1:
		arr.append(temp)
	if not arr:
		arr.append(n)
	return arr
(A, B) = list(map(int, input().split()))
gcd = math.gcd(A, B)
f = factorization(gcd)
print(len(f))


def factrization(n):
	arr = []
	temp = n
	for i in range(2, int(n ** 0.5 // 1) + 2):
		if temp % i == 0:
			cnt = 0
			while temp % i == 0:
				cnt += 1
				temp //= i
			arr.append(i)
	if temp != 1:
		arr.append(temp)
	if arr == []:
		arr.append(n)
	return arr
(a, b) = map(int, input().split())
ans = 0
la = factrization(a)
lb = factrization(b)
if 1 not in la:
	la.append(1)
if 1 not in lb:
	lb.append(1)
for i in la:
	if i in lb:
		ans += 1
print(ans)


import sys
MOD = 10 ** 9 + 7
INF = 10 ** 9
PI = 3.141592653589793

def read_str():
	return sys.stdin.readline().strip()

def read_int():
	return int(sys.stdin.readline().strip())

def read_ints():
	return map(int, sys.stdin.readline().strip().split())

def read_ints2(x):
	return map(lambda num: int(num) - x, sys.stdin.readline().strip().split())

def read_str_list():
	return list(sys.stdin.readline().strip().split())

def read_int_list():
	return list(map(int, sys.stdin.readline().strip().split()))

def GCD(a: int, b: int) -> int:
	return b if a % b == 0 else GCD(b, a % b)

def LCM(a: int, b: int) -> int:
	return a * b // GCD(a, b)

def factorization(num):
	prime = []
	n = num
	p = 2
	while p * p <= num:
		if n % p == 0:
			cnt = 0
			while n % p == 0:
				cnt += 1
				n //= p
			prime.append((p, cnt))
		p += 1
	if n != 1:
		prime.append((n, 1))
	if not prime:
		prime.append((num, 1))
	return prime

def Main():
	(a, b) = read_ints()
	g = GCD(a, b)
	if g == 1:
		print(1)
		return
	prime = factorization(g)
	print(len(prime) + 1)

def __starting_point():
	Main()
__starting_point()


import math

def factorization(n):
	arr = []
	temp = n
	for i in range(2, int(pow(n, 1 / 2)) + 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, B) = map(int, input().split())
gcd_num = math.gcd(A, B)
if gcd_num == 1:
	print(1)
else:
	print(len(factorization(gcd_num)) + 1)


(n, m) = map(int, input().split(' '))

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

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
s = set(divisor(n)).intersection(set(divisor(m)))
ans = 1
for ss in s:
	if len(prime_factorize(ss)) == 1:
		ans += 1
print(ans)


from fractions import *
g = gcd(*map(int, input().split()))
c = i = 1
while i * i <= g and g > 1:
	i += 1
	c += g % i < 1
	while g % i < 1:
		g /= i
print(c + (g > 1))


import math
(a, b) = map(int, input().split())
while b != 0:
	(a, b) = (b, a % b)
n = a
rn = int(math.sqrt(n))
cnt = 1
for i in range(2, rn + 1):
	if n % i == 0:
		while n % i == 0:
			n = n // i
		cnt += 1
if n == 1:
	print(cnt)
else:
	print(cnt + 1)


(A, B) = map(int, input().split())
(a, b) = (A, B)
while b != 0:
	(a, b) = (b, a % b)
prod = 1
s = 1
p = 2
g = a
while a != 1:
	i = 0
	while a % p == 0:
		i += 1
		a //= p
		prod *= p
	if i != 0:
		s += 1
	p += 1
	if p > int(g ** (1 / 2)) and prod != g:
		s += 1
		break
print(s)


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

def gcd(x, y):
	if y == 0:
		return x
	return gcd(y, x % y)
n = gcd(a, b)
ans = 0
i = 2
while i * i <= n:
	if n % i == 0:
		while n % i == 0:
			n /= i
		ans += 1
	i += 1
if n != 1:
	ans += 1
print(ans + 1)


import math
from math import gcd
(A, B) = map(int, input().split())
g = gcd(A, B)
n = int(math.sqrt(g))
d_list = list()
for i in range(1, n + 1):
	if g % i == 0:
		j = g // i
		d_list.append(i)
		if j != 1:
			d_list.append(j)
d_list.sort()
ans_list = [1]
d_list.pop(0)
while d_list:
	t = d_list.pop(0)
	ans_list.append(t)
	d_list = [i for i in d_list if i % t != 0]
print(len(ans_list))


(a, b) = map(int, input().split())
(m, n) = (a, b)
c = 0
while n != 0:
	c = m % n
	m = n
	n = c
li = [1]
for i in range(2, int(m ** 0.5) + 1):
	while m % i == 0:
		m //= i
		li.append(i)
li.append(m)
print(len(set(li)))


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)
	return
print(len(d) + 1)


import math
import collections

def prime_factorize(n):
	s = []
	while n % 2 == 0:
		s.append(2)
		n //= 2
	f = 3
	while f * f <= n:
		if n % f == 0:
			s.append(f)
			n //= f
		else:
			f += 2
	if n != 1:
		s.append(n)
	return s
(a, b) = map(int, input().split())
g = math.gcd(a, b)
c = collections.Counter(prime_factorize(g))
print(len(c.values()) + 1)


import math
(a, b) = map(int, input().split())

def gcd(a, b):
	if a < b:
		(a, b) = (b, a)
	if b == 0:
		return a
	while b > 0:
		r = a % b
		a = b
		b = r
	return a
g = gcd(a, b)
x = g
s = set()
for i in range(2, int(math.sqrt(g)) + 1):
	while x % i == 0:
		s.add(i)
		x /= i
if x != 1:
	s.add(x)
print(len(s) + 1)


def factorize(n):
	fct = []
	(b, e) = (2, 0)
	while b * b <= n:
		while n % b == 0:
			n //= b
			e += 1
		if e > 0:
			fct.append((b, e))
		(b, e) = (b + 1, 0)
	if n > 1:
		fct.append((n, 1))
	return fct
(a, b) = map(int, input().split())
ap = set()
for (prime, count) in factorize(a):
	ap.add(prime)
bp = set()
for (prime, count) in factorize(b):
	bp.add(prime)
print(len(ap & bp) + 1)


import math
(a, b) = map(int, input().split())
ans = [1]
c = math.gcd(a, b)
for i in range(2, int(c ** (1 / 2)) + 1):
	if c % i == 0:
		while c % i == 0:
			c //= i
		ans.append(i)
if c != 1:
	ans.append(c)
print(len(ans))


import math
(a, b) = map(int, input().split())
t = math.gcd(a, b)

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
cnt = len(set(prime_decomposition(t)))
print(cnt + 1)


def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)
(a, b) = [int(i) for i in input().split()]
val = gcd(a, b)
ct = 1
for i in range(2, int(val ** 0.5) + 2):
	if val % i == 0:
		ct += 1
		while val % i == 0:
			val //= i
if val != 1:
	ct += 1
print(ct)


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())
print(len(set(trial_division(A)) & set(trial_division(B))))


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

def gcd(x, y):
	while y != 0:
		cur = x
		x = y
		y = cur % y
	return x
t = gcd(a, b)
L = []
for i in range(2, 10 ** 6 + 1):
	while t % i == 0:
		t = t // i
		if i not in L:
			L.append(i)
if t != 1:
	L.append(t)
print(len(L) + 1)


(a, b) = map(int, input().split())
ans = 1
for i in range(2, int(min(a, b) ** 0.5) + 1):
	if a % i == 0 and b % i == 0:
		ans += 1
	while a % i == 0:
		a //= i
	while b % i == 0:
		b //= i
if a != 1 and b != 1 and (a % b == 0 or b % a == 0):
	ans += 1
print(ans)


def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
(a, b) = map(int, input().split())
n = gcd(a, b)
primes = []
MAX = 10 ** 6 + 10
is_prime = [False] * 2 + [True] * (MAX - 2)
for i in range(2, MAX):
	if is_prime[i]:
		primes.append(i)
		for j in range(i * i, MAX, i):
			is_prime[j] = False
cnt = 1
for p in primes:
	if n % p == 0:
		cnt += 1
		while n % p == 0:
			n /= p
if n != 1:
	cnt += 1
print(cnt)


def primeFact(n):
	i = 2
	pl = []
	while i * i <= n:
		while n % i == 0:
			n /= i
			pl.append(i)
		i += 1
	if n > 1:
		pl.append(int(n))
	return pl
(a, b) = map(int, input().split())
print(len(set(primeFact(a)) & set(primeFact(b))) + 1)


url = 'https://atcoder.jp//contests/abc142/tasks/abc142_d'
import math

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

def main():
	(a, b) = list(map(int, input().split()))
	abgcd = math.gcd(a, b)
	s = set(prime_factorize(abgcd))
	print(len(s) + 1)

def __starting_point():
	main()
__starting_point()


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) = map(int, input().split())
print(1 + len(prefactor(a) & prefactor(b)))


import math

def factrize(num):
	factor = {}
	div = 2
	s = int(num ** 0.5) + 1
	while div < s:
		div_cnt = 0
		while num % div == 0:
			div_cnt += 1
			num //= div
		if div_cnt != 0:
			factor[div] = div_cnt
		div += 1
	if num > 1:
		factor[num] = 1
	return factor
(a, b) = map(int, input().split())
g = math.gcd(a, b)
print(len(factrize(g)) + 1)


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) = map(int, input().split())
d = set(division(gcd(a, b)))
print(len(d))


s = set

def f(n):
	a = 2
	t = []
	while a * a <= n:
		while n % a == 0:
			n //= a
			t.append(a)
		a += 1
	if n > 1:
		t.append(n)
	return t
(a, b) = map(int, input().split())
print(len(s(f(a)) & s(f(b))) + 1)


(A, B) = map(int, input().split())
Pa = {1}
Pb = {1}
a = 2
while a * a <= A:
	if A % a == 0:
		A = A // a
		Pa.add(a)
	else:
		a += 1
if A > 1:
	Pa.add(A)
b = 2
while b * b <= B:
	if B % b == 0:
		B = B // b
		Pb.add(b)
	else:
		b += 1
if B > 1:
	Pb.add(B)
print(len(Pa & Pb))


import math
(a, b) = map(int, input().split())
n = math.gcd(a, b)
cnt = 1
f = 2
d = n
while f * f <= n:
	if d % f == 0:
		cnt += 1
		while d % f == 0:
			d = d // f
	f += 1
if d != 1:
	cnt += 1
print(cnt)


def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
import math
(a, b) = map(int, input().split())
x = gcd(a, b)
c = x
ans = 1
for i in range(2, int(math.sqrt(x)) + 1):
	if c % i == 0:
		ans += 1
	while c % i == 0:
		c = c // i
if c > 1:
	ans += 1
print(ans)


(a, b) = list(map(int, input().split()))
if a == 1 and b == 1:
	print(1)
	return

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
ans = 0
A = factorization(a)
B = factorization(b)
for i in A:
	for j in B:
		if i[0] == j[0]:
			ans += 1
print(ans + 1)


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

def prime(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 table
print(len(list(set(prime(a)).intersection(set(prime(b))))) + 1)


(n, m) = map(int, input().split())
while m:
	(n, m) = (m, n % m)
pf = {}
for i in range(2, int(n ** 0.5) + 1):
	while n % i == 0:
		pf[i] = pf.get(i, 0) + 1
		n //= i
if n > 1:
	pf[n] = 1
if pf == {}:
	print(1)
else:
	print(len(pf) + 1)


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

def ela(g):
	s = {1}
	i = 2
	while i * i <= g:
		while g % i == 0:
			g //= i
			s.add(i)
		i += 1
	if g != 1:
		s.add(g)
	return s
(a, b) = map(int, input().split())
G = gcd(max(a, b), min(a, b))
print(len(ela(G)))


import math

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

def count_prime_factorize(n):
	res = 1
	i = 2
	while i ** 2 <= n:
		if n % i == 0:
			res += 1
			while n % i == 0:
				n //= i
		i += 1
	if n != 1:
		res += 1
	return res
(a, b) = list(map(int, input().strip().split()))
x = gcd(a, b)
res = count_prime_factorize(x)
print(res)


import math

def main():
	(a, b) = list(map(int, input().split()))
	gcd = math.gcd(a, b)
	ans = [1]
	while gcd % 2 == 0:
		ans.append(2)
		gcd = gcd // 2
	f = 3
	while f * f <= gcd:
		if gcd % f == 0:
			ans.append(f)
			gcd = gcd // f
		else:
			f += 2
	if gcd != 1:
		ans.append(gcd)
	print(len(set(ans)))

def __starting_point():
	main()
__starting_point()


(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])
	return arr
facts_A = factorization(A)
cnt = 0
for l in facts_A:
	if B % l[0] == 0:
		cnt += 1
print(cnt + 1)


(a, b) = 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(len(set(A) & set(B)))


import math
(A, B) = map(int, input().split())
while B > 0:
	(A, B) = (B, A % B)
N = A
ans = 1
i = 2
while i * i <= N:
	if N % i == 0:
		while N % i == 0:
			N //= i
		ans += 1
	i += 1
if N > 1:
	ans += 1
print(ans)


(A, B) = map(int, input().split())
import math
import collections

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
c = prime_factorize(math.gcd(A, B))
c = collections.Counter(c)
c = c.values()
print(len(c) + 1)


def f(n):
	ret = {1}
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			ret.add(i)
			while n % i == 0:
				n //= i
		else:
			pass
	if n:
		ret.add(n)
	return ret
(a, b) = map(int, input().split())
print(len(f(a) & f(b)))


import math
(A, B) = map(int, input().split())
C = math.gcd(A, B)

def prime(N):
	lsprime = [0, 0] + [1 for i in range(N - 1)]
	lsprime2 = []
	for i in range(N + 1):
		if lsprime[i] == 0:
			continue
		lsprime2.append(i)
		k = i
		while i <= N:
			lsprime[i] = 0
			i += k
	return lsprime2

def prime2(N):
	arr = []
	temp = N
	setprime = set()
	for i in range(2, int(-(-N ** 0.5 // 1)) + 1):
		if temp % i == 0:
			cnt = 0
			setprime.add(i)
			while temp % i == 0:
				cnt += 1
				temp //= i
			arr.append([i, cnt])
	if temp != 1:
		arr.append([temp, 1])
		setprime.add(temp)
	if arr == []:
		arr.append([N, 1])
	return (arr, setprime)
(_, setp) = prime2(C)
print(len(setp) + 1)


(a, b) = 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))
cnt = 0
for i in A:
	if i in B:
		cnt += 1
print(cnt + 1)


from math import gcd

def resolve():

	def prime_factorize(n):
		if 2 <= n < 4:
			return [n]
		res = []
		i = 2
		while i * i <= n:
			while n % i == 0:
				res.append(i)
				n //= i
			i += 1
		if n != 1:
			res.append(n)
		return set(res)
	(a, b) = list(map(int, input().split()))
	g = gcd(a, b)
	ans = prime_factorize(g)
	print(len(ans) + 1)

def __starting_point():
	resolve()
__starting_point()


from math import gcd
(A, B) = map(int, input().split())

def factorize(n):
	arr = []
	temp = n
	for i in range(2, int(n ** 0.5) + 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
n = gcd(A, B)
ans = factorize(n)
if ans[0][0] == 1:
	print(1)
	return
print(len(ans) + 1)


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

def gcd(a, b):
	if a == 0:
		return b
	elif b == 0:
		return a
	else:
		return gcd(b, a % b)
p = gcd(a, b)
factors = {}
while p > 1:
	f = False
	for i in range(2, int(p ** 0.5) + 1):
		if p % i == 0:
			if i in factors:
				factors[i] += 1
			else:
				factors[i] = 1
			p //= i
			f = True
			break
	if not f:
		if p in factors:
			factors[p] += 1
		else:
			factors[p] = 1
		break
print(len(factors) + 1)


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

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

def factorize(x):
	i = 2
	res = []
	while i * i <= x:
		while x % i == 0:
			x //= i
			res.append(i)
		i += 1
	if x > 1:
		res.append(x)
	return res
g = gcd(a, b)
f = factorize(g)
print(len(set(f)) + 1)


(a, b) = map(int, input().split())
A = [1]
for i in range(2, int(a ** 0.5) + 1):
	if a % i == 0:
		while a % i == 0:
			a //= i
		A.append(i)
if a > 1:
	A.append(a)
B = [1]
for i in range(2, int(b ** 0.5) + 1):
	if b % i == 0:
		while b % i == 0:
			b //= i
		B.append(i)
if b > 1:
	B.append(b)
can = 0
for i in A:
	if i in B:
		can += 1
print(can)


def GCD(a, b):
	while b:
		(a, b) = (b, a % b)
	return a
(a, b) = map(int, input().split())
n = GCD(a, b)
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)
print(len(set(table)) + 1)


(a, b) = (int(i) for i in input().split())

def gcd(a, b):
	if a % b:
		return gcd(b, a % b)
	else:
		return b
g = gcd(a, b)
(num, ans) = (g, 1)
for i in range(2, int(g ** 0.5) + 1):
	if num % i == 0:
		ans += 1
		while num % i == 0:
			num //= i
if num != 1:
	ans += 1
print(ans)


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
from math import gcd
(a, b) = map(int, input().split())
g = gcd(a, b)
if g == 1:
	print(1)
else:
	print(len(factorization(g)) + 1)


import math
(A, B) = map(int, input().split())
gcd_ab = math.gcd(A, B)
factors = set()
i = 2
while i <= math.ceil(math.sqrt(gcd_ab)):
	if gcd_ab % i == 0:
		factors.add(i)
		gcd_ab = gcd_ab // i
	else:
		i += 1
factors.add(gcd_ab)
factors.add(1)
print(len(factors))


(x, y) = map(int, input().split())

def pr(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
print(len(set(pr(x)) & set(pr(y))) + 1)


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)


def gcd(a: int, b: int):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)
(a, b) = map(int, input().split())
g = gcd(a, b)
ans = set([1])
for i in range(2, 1000000):
	while g % i == 0:
		g = g // i
		ans.add(i)
if g > 1:
	ans.add(g)
print(len(ans))


from fractions import *
(a, b) = map(int, input().split())
g = gcd(a, b)
l = [g]
for i in range(2, int(g ** 0.5) + 1):
	if g % i < 1:
		l += [i, g // i]
c = 1
for i in sorted(l):
	if g < 2:
		break
	if g % i < 1:
		c += 1
	while g % i < 1:
		g //= i
print(c)


def factor(n):
	factor_set = {1}
	tmp = int(n ** 0.5) + 1
	for i in range(2, tmp):
		while n % i == 0:
			n = n // i
			factor_set.add(i)
	factor_set.add(n)
	return factor_set
(A, B) = map(int, input().split())
print(len(factor(A) & factor(B)))


import bisect, collections, copy, itertools, math, string
import sys

def I():
	return int(sys.stdin.readline().rstrip())

def LI():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def S():
	return sys.stdin.readline().rstrip()

def LS():
	return list(sys.stdin.readline().rstrip().split())

def main():

	def prime_factor(n):
		lst = []
		while n % 2 == 0:
			n //= 2
			lst.append(2)
		f = 3
		while f ** 2 <= n:
			if n % f == 0:
				n //= f
				lst.append(f)
			else:
				f += 2
		if n != 1:
			lst.append(n)
		return lst
	(a, b) = LI()
	g = math.gcd(a, b)
	prm = prime_factor(g)
	ans = len(set(prm)) + 1
	print(ans)
main()


import math
ab = [int(i) for i in input().split()]
ab = math.gcd(ab[0], ab[1])
dic = {}
n = 2
while n ** 2 <= ab:
	if ab % n:
		n += 1
	else:
		ab //= n
		dic[n] = dic.get(n, 0) + 1
if 1 < ab:
	dic[ab] = dic.get(ab, 0) + 1
print(len(dic) + 1)


def primeFac(n):
	res = {1}
	for i in range(2, int(n ** 0.5) + 1):
		while n % i == 0:
			n //= i
			res.add(i)
		if n <= 1:
			break
	if n > 1:
		res.add(n)
	return res
(a, b) = map(int, input().split())
res = primeFac(a) & primeFac(b)
print(len(res))


(a, b) = 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)))


def gcd(a, b):
	return gcd(b, a % b) if b else a
(A, B) = map(int, input().split())
c = gcd(A, B)
d = set()
i = 2
while i * i <= c:
	while c % i == 0:
		c /= i
		d.add(i)
	i += 1
if c != 1:
	d.add(c)
print(len(d) + 1)


import math
(A, B) = map(int, input().split())
gcd = math.gcd(A, B)
ans = [1]
while gcd % 2 == 0:
	ans.append(2)
	gcd = gcd // 2
f = 3
while f * f <= gcd:
	if gcd % f == 0:
		ans.append(f)
		gcd = gcd // f
	else:
		f += 2
if gcd != 1:
	ans.append(gcd)
print(len(set(ans)))


from math import gcd, sqrt, floor
(a, b) = map(int, input().split())
c = gcd(a, b)
x = []
for i in range(1, floor(sqrt(c)) + 1):
	if c % i == 0:
		x.append(i)
		x.append(c // i)
x.sort()
y = []
i = 1
while c > 1 and i < len(x):
	if c % x[i] == 0:
		y.append(x[i])
		c = c // x[i]
	else:
		i += 1
print(len(set(y)) + 1)


import math
(a, b) = map(int, input().split())
x = math.gcd(a, b)
bun = [0] * int(math.sqrt(x) + 1)
bun[1] = 1
for i in range(2, len(bun)):
	while x % i == 0:
		if bun[i] == 0:
			bun[i] += 1
		x = x // i
ans = sum(bun)
if x > 1:
	ans += 1
print(ans)


(a, b) = 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))


import math
(a, b) = map(int, input().split())

def factorization(n):
	arr = []
	tmp = n
	for i in range(2, int(n ** 0.5) + 1):
		while tmp % i == 0:
			tmp //= i
			arr.append(i)
	if tmp != 1:
		arr.append(tmp)
	if arr == []:
		arr.append(n)
	return list(set(arr))
ans = len(factorization(math.gcd(a, b)))
print(ans + 1 if math.gcd(a, b) != 1 else 1)


import math
(a, b) = 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)


import math
(A, B) = list(map(int, input().split()))
gcd = math.gcd(A, B)
d = []
if A == 1 or B == 1:
	print(1)
	return
ans = [1]
while gcd % 2 == 0:
	gcd //= 2
	ans.append(2)
i = 3
while i * i <= gcd:
	if gcd % i == 0:
		ans.append(i)
		gcd //= i
	else:
		i += 2
if gcd != 1:
	ans.append(gcd)
print(len(set(ans)))


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

	def primeLst(x):
		acc = []
		f = 2
		while f * f <= x:
			if x % f == 0:
				acc.append(f)
				x //= f
			else:
				f += 1
		if x != 1:
			acc.append(x)
		return acc
	a = set(primeLst(A))
	b = set(primeLst(B))
	if len(a) * len(b) == 0:
		ans = 1
	else:
		ans = len(a & b) + 1
	print(ans)
	return

def __starting_point():
	main()
__starting_point()


import math
from math import gcd, pi, sqrt
INF = float('inf')
import sys
sys.setrecursionlimit(10 ** 6)
import itertools
from collections import Counter, deque

def i_input():
	return int(input())

def i_map():
	return list(map(int, input().split()))

def i_list():
	return list(i_map())

def i_row(N):
	return [i_input() for _ in range(N)]

def i_row_list(N):
	return [i_list() for _ in range(N)]

def s_input():
	return input()

def s_map():
	return input().split()

def s_list():
	return list(s_map())

def s_row(N):
	return [s_input for _ in range(N)]

def s_row_str(N):
	return [s_list() for _ in range(N)]

def s_row_list(N):
	return [list(s_input()) for _ in range(N)]

def main():
	(a, b) = i_map()

	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 = set(prime_decomposition(a))
	b = set(prime_decomposition(b))
	print(len(a & b) + 1)

def __starting_point():
	main()
__starting_point()


def gcd(a, b):
	if not b:
		return a
	return gcd(b, a % b)
(a, b) = map(int, input().split())
n = gcd(a, b)
i = 2
j = 1
while i * i <= n:
	up = True
	while n % i == 0:
		if up:
			j += 1
			up = False
		n /= i
	i += 1
if n != 1:
	j += 1
print(j)


from math import *
g = gcd(*map(int, input().split()))
D = {}
n = 2
while n * n <= g:
	if g % n:
		n += 1
	else:
		g //= n
		D[n] = D.get(n, 0) + 1
if 1 < g:
	D[g] = D.get(g, 0) + 1
print(len(D) + 1)


from math import sqrt
(a, b) = map(int, input().split())
L = []
if a < b:
	(a, b) = (b, a)
while b != 0:
	r = a % b
	(a, b) = (b, r)
G = a
for i in range(2, int(sqrt(G)) + 1):
	if G % i == 0:
		L.append(i)
		while G % i == 0:
			G /= i
if G != 1:
	L.append(G)
print(len(L) + 1)


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

def factorization(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
s_a = set(factorization(a))
s_b = set(factorization(b))
ans_arr = s_a & s_b
print(len(ans_arr) + 1)


(A, B) = map(int, input().split())
ans = 1
for i in range(2, 1 + int(min(A ** 0.5, B ** 0.5))):
	if A % i == 0 and B % i == 0:
		ans += 1
	while A % i == 0:
		A //= i
	while B % i == 0:
		B //= i
if A != 1 and B != 1 and (A % B == 0 or B % A == 0):
	ans += 1
print(ans)


import math
(n, m) = map(int, input().split())
gcd = math.gcd(m, n)
i = 1
ans = []
max = int(math.sqrt(gcd))
for i in range(2, max + 2):
	while gcd % i == 0:
		ans.append(i)
		gcd //= i
if gcd > 1:
	ans.append(n)
print(len(set(ans)) + 1)


(a, b) = map(int, input().split())
while b > 0:
	(a, b) = (b, a % b)
prime = []
for i in range(2, int(a ** 0.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)


(a, b) = map(int, input().split())
while b != 0:
	(a, b) = (b, a % b)
n = a
s = set()
s.add(1)
while n % 2 == 0:
	n //= 2
	s.add(2)
f = 3
while f * f <= n:
	if n % f == 0:
		n //= f
		s.add(f)
	else:
		f += 2
if n != 1:
	s.add(n)
print(len(s))


(a, b) = map(int, input().split())
while a > 0:
	(a, b) = (b % a, a)
ret = 1
d = 2
while b >= d * d:
	if b % d == 0:
		ret += 1
		while b % d == 0:
			b //= d
	d += 1
if b > 1:
	ret += 1
print(ret)


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

def factorizaion(n):
	p = 2
	fcr = []
	while p * p <= n:
		while n % p == 0:
			fcr.append(p)
			n //= p
		p += 1
	if n > 1:
		fcr.append(n)
	return fcr
x = factorizaion(a)
y = factorizaion(b)
print(len(set(x) & set(y)) + 1)


from math import sqrt
from math import ceil

def prime_factorization(n):
	pfs = [1]
	i = 2
	for i in range(2, int(ceil(sqrt(n)))):
		while n % i == 0:
			pfs.append(i)
			n //= i
	if n > 0:
		pfs.append(n)
	return pfs
(a, b) = map(int, input().split())

def bit_search(pfs):
	m = len(pfs)
	ds = set([])
	for i in range(1 << m):
		d = 1
		for j in range(m):
			if i & 1 << m > 0:
				d *= pfs[m]
		ds.add(d)
	return ds

def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)
gcdab = gcd(a, b)
pfsab = prime_factorization(gcdab)
pfsabset = set(pfsab)
print(len(pfsabset))


import math

def using_sqrt(k):
	factor = 0
	if k % 2 == 0 and k != 2:
		return False
	for divisor in range(2, math.floor(math.sqrt(k)) + 1):
		if k % divisor == 0:
			factor += 1
	if factor == 0:
		return True
	else:
		return False

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 make_codivisors(n):
	divisors = []
	n0divisors = make_divisors(n[0])
	n0len = len(n0divisors)
	for i in n0divisors:
		for j in range(1, len(n)):
			if n[j] % i != 0:
				break
			if j == len(n) - 1:
				divisors.append(i)
	return divisors
(a, b) = map(int, input().split())
div = make_codivisors([a, b])
ans = 0
for i in div:
	if i == 1:
		ans += 1
	elif using_sqrt(i):
		ans += 1
print(ans)


import math

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, B) = map(int, input().split())
Af = factorization(A)
Bf = factorization(B)
As = set()
Bs = set()
for i in range(len(Af)):
	As.add(Af[i][0])
for j in range(len(Bf)):
	Bs.add(Bf[j][0])
if A == 1 and B == 1:
	print(1)
else:
	print(len(As & Bs) + 1)


from math import gcd
(a, b) = map(int, input().split())
x = gcd(a, b)
cnt = 1
for i in range(2, int(x ** 0.5) + 1):
	if x == 1:
		break
	if x % i == 0:
		cnt += 1
		while x % i == 0:
			x //= i
else:
	if x != 1:
		cnt += 1
print(cnt)


def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)
(a, b) = map(int, input().split())
x = gcd(a, b)
if x == 1:
	print(1)
	exit()
s = []
i = 2
while i * i <= x:
	if x % i == 0:
		s.append(i)
		x /= i
	else:
		i += 1
s.append(x)
print(len(set(s)) + 1)


from math import gcd
(A, B) = map(int, input().split())
g = gcd(A, B)
plist = []
for i in range(2, int(g ** 0.5) + 1):
	if g % i == 0:
		plist.append(i)
		while g % i == 0:
			g //= i
if g != 1:
	plist.append(g)
print(len(plist) + 1)


from math import gcd
(A, B) = map(int, input().split())
m = gcd(A, B)
num = int(m ** 0.5)
ans = 1
for i in range(2, num + 1):
	if m % i:
		continue
	ans += 1
	while not m % i:
		m /= i
if m > 1:
	ans += 1
print(ans)


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]

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, B) = list(map(int, input().split()))
A_yakusu = make_divisors(A)
B_yakusu = make_divisors(B)
yakusu_set = set(A_yakusu) & set(B_yakusu)
yakusu_list = list(yakusu_set)
if max(yakusu_list) != 1:
	print(len(factorization(max(yakusu_list))) + 1)
else:
	print(1)


(a, b) = [int(i) for i in input().split()]
l = [1]
if a % 2 == 0:
	l.append(2)
while a % 2 == 0:
	a /= 2
i = 3
while a > i ** 2:
	if a % i == 0:
		l.append(i)
	while a % i == 0:
		a /= i
	i += 2
if a not in l:
	l.append(a)
cnt = 0
for i in l:
	if b % i == 0:
		cnt += 1
print(cnt)


def gcd(a, b):
	if a == 0:
		return b
	else:
		return gcd(b % a, a)
(A, B) = map(int, input().split())
p = set([1])
g = gcd(A, B)
for d in range(2, g):
	while g % d == 0:
		p.add(d)
		g //= d
	if d * d >= g:
		break
if g >= 2:
	p.add(g)
print(len(p))


(a, b) = map(int, input().split())
t = min(a, b)
t1 = t
s = max(a, b)
c = 1
i = 2
while t > 1 and i <= int(t1 ** 0.5 + 1):
	frag = 0
	while t % i == 0:
		t = t / i
		if frag == 0 and s % i == 0:
			c = c + 1
		frag = 1
	if i == 2:
		i = 3
	else:
		i = i + 2
if s % t == 0 and t > int(t1 ** 0.5 + 1):
	c = c + 1
print(c)


import math

def divisors(x):
	l = [[], []]
	for i in range(1, int(math.sqrt(x)) + 1):
		if x % i == 0:
			if i ** 2 != x:
				l[0].append(i)
				l[1].append(x // i)
			else:
				l[0].append(i)
	return l[0] + l[1][::-1]

def primenumber(x):
	for i in range(2, int(math.sqrt(x)) + 1):
		if x % i == 0:
			return False
	return True
(a, b) = map(int, input().split())
cnt = 0
for i in divisors(math.gcd(a, b)):
	if i == 1:
		cnt += 1
	elif primenumber(i):
		cnt += 1
print(cnt)


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

def prime_factorization(x):
	import math
	re = []
	i = 2
	while x != 1:
		if x % i == 0:
			re.append(i)
			x //= i
		else:
			i += 1
			if i > math.sqrt(x):
				re.append(x)
				break
	return re

def solve(A, B):
	div = gcd(A, B)
	print(len(set(prime_factorization(div))) + 1)

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


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)


from fractions import *
g = gcd(*map(int, input().split()))
s = {1}
for i in range(2, int(g ** 0.5) + 1):
	while g % i < 1:
		g //= i
		s |= {i}
print(len(s) + (g > 1))


import math
(A, B) = [int(_) for _ in input().split()]
N = math.gcd(A, B)
ans = 1
for i in range(2, int(math.sqrt(N) + 1) + 1):
	if N % i == 0:
		ans += 1
		while N % i == 0:
			N //= i
if N > 1:
	ans += 1
print(ans)


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

def gcd(x, y):
	if x % y == 0:
		return y
	else:
		return gcd(y, x % y)
n = gcd(a, b)
i = 2
ans = [1]
while i * i <= n:
	if n % i == 0:
		n /= i
		ans.append(i)
	else:
		i += 1
ans.append(n)
print(len(set(ans)))


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) = 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)


(A, B) = map(int, input().split())
C = []
D = []

def prime_factor(n):
	E = []
	for i in range(2, int(n ** 0.5) + 1):
		while n % i == 0:
			E.append(i)
			n = n // i
	if n != 1:
		E.append(n)
	return E
C = prime_factor(A)
D = prime_factor(B)
f = set(C) & set(D)
print(len(f) + 1)