def gcd(a,b):
    if a%b == 0:
        return b
    else:
        return gcd(b, a%b)
ans = 1
def fact(n):
    global ans
    p = 2
    while p**2 <= n:
        flag = False
        while n%p == 0:
            flag = True
            n /= p
        p += 1
        if flag:
            ans += 1
    if n!= 1:
        ans += 1
a,b = map(int, input().split())
g = gcd(a,b)
fact(g)
print(ans) def gcd(a,b):
    if a%b == 0:
        return b
    else:
        return gcd(b, a%b) gcd if a%b == 0:
        return b
    else:
        return gcd(b, a%b) a%b == 0 a%b a b 0 return b b return gcd(b, a%b) gcd(b, a%b) gcd b a%b a b a a b b ans = 1 ans 1 def fact(n):
    global ans
    p = 2
    while p**2 <= n:
        flag = False
        while n%p == 0:
            flag = True
            n /= p
        p += 1
        if flag:
            ans += 1
    if n!= 1:
        ans += 1 fact global ans p = 2 p 2 while p**2 <= n:
        flag = False
        while n%p == 0:
            flag = True
            n /= p
        p += 1
        if flag:
            ans += 1
     p**2 <= n p**2 p 2 n flag = False flag False while n%p == 0:
            flag = True
            n /= p
         n%p == 0 n%p n p 0 flag = True flag True n /= p n p p += 1 p 1 if flag:
            ans += 1
     flag ans += 1 ans 1 if n!= 1:
        ans += 1 n!= 1 n 1 ans += 1 ans 1 n n 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 fact(g) fact g print(ans) print ans def fact(n):
    global ans
    p = 2
    while p**2 <= n:
        flag = False
        while n%p == 0:
            flag = True
            n /= p
        p += 1
        if flag:
            ans += 1
    if n!= 1:
        ans += 1 def fact(n):
    global ans
    p = 2
    while p**2 <= n:
        flag = False
        while n%p == 0:
            flag = True
            n /= p
        p += 1
        if flag:
            ans += 1
    if n!= 1:
        ans += 1 fact ans = 1 1 ans a,b = map(int, input().split()) map(int, input().split()) a def gcd(a,b):
    if a%b == 0:
        return b
    else:
        return gcd(b, a%b) def gcd(a,b):
    if a%b == 0:
        return b
    else:
        return gcd(b, a%b) gcd g = gcd(a,b) gcd(a,b) g b = map(int, input().split()) map(int, input().split()) b
def gcd(a,b):
    if a%b == 0:
        return b
    else:
        return gcd(b, a%b)
ans = 1
def fact(n):
    global ans
    p = 2
    while p**2 <= n:
        flag = False
        while n%p == 0:
            flag = True
            n /= p
        p += 1
        if flag:
            ans += 1
    if n!= 1:
        ans += 1
a,b = map(int, input().split())
g = gcd(a,b)
fact(g)
print(ans)