import math
from fractions import gcd
a, b = map(int, input().split())
g = gcd(a, b)
sqrt = math.floor(g ** 0.5)
factors = [1]
z = g
for i in range(2, sqrt + 1):
    if not z % i:
        factors.append(i)
        while z % i == 0:
            z //= i
if z > 1:
    factors.append(z)
print(len(factors)) import math math from fractions import gcd a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b g = gcd(a, b) g gcd(a, b) gcd a b sqrt = math.floor(g ** 0.5) sqrt math.floor(g ** 0.5) math.floor math floor g ** 0.5 g 0.5 factors = [1] factors [1] 1 z = g z g for i in range(2, sqrt + 1):
    if not z % i:
        factors.append(i)
        while z % i == 0:
            z //= i i range(2, sqrt + 1) range 2 sqrt + 1 sqrt 1 if not z % i:
        factors.append(i)
        while z % i == 0:
            z //= i not z % i z % i z i factors.append(i) factors.append factors append i while z % i == 0:
            z //= i z % i == 0 z % i z i 0 z //= i z i if z > 1:
    factors.append(z) z > 1 z 1 factors.append(z) factors.append factors append z print(len(factors)) print len(factors) len factors z //= i i z a, b = map(int, input().split()) map(int, input().split()) a b = map(int, input().split()) map(int, input().split()) b g = gcd(a, b) gcd(a, b) g factors = [1] [1] factors z = g g z sqrt = math.floor(g ** 0.5) math.floor(g ** 0.5) sqrt
import math
from fractions import gcd
a, b = map(int, input().split())
g = gcd(a, b)
sqrt = math.floor(g ** 0.5)
factors = [1]
z = g
for i in range(2, sqrt + 1):
    if not z % i:
        factors.append(i)
        while z % i == 0:
            z //= i
if z > 1:
    factors.append(z)
print(len(factors))
