from math import*
def factrization_prime(number):
    factor = {}
    div = 2
    s = sqrt(number)
    while div < s:
        div_cnt = 0
        while number % div == 0:
            div_cnt += 1
            number //= div
        if div_cnt != 0:
            factor[div] = div_cnt
        div += 1
    if number > 1:
        factor[number] = 1
    return factor
A, B = map(int, input().split())
f = factrization_prime(gcd(A,B))
print(len(f)+1) from math import* def factrization_prime(number):
    factor = {}
    div = 2
    s = sqrt(number)
    while div < s:
        div_cnt = 0
        while number % div == 0:
            div_cnt += 1
            number //= div
        if div_cnt != 0:
            factor[div] = div_cnt
        div += 1
    if number > 1:
        factor[number] = 1
    return factor factrization_prime factor = {} factor {} div = 2 div 2 s = sqrt(number) s sqrt(number) sqrt number while div < s:
        div_cnt = 0
        while number % div == 0:
            div_cnt += 1
            number //= div
        if div_cnt != 0:
            factor[div] = div_cnt
        div += 1
     div < s div s div_cnt = 0 div_cnt 0 while number % div == 0:
            div_cnt += 1
            number //= div
         number % div == 0 number % div number div 0 div_cnt += 1 div_cnt 1 number //= div number div if div_cnt != 0:
            factor[div] = div_cnt
         div_cnt != 0 div_cnt 0 factor[div] = div_cnt factor[div] factor div div_cnt div += 1 div 1 if number > 1:
        factor[number] = 1
     number > 1 number 1 factor[number] = 1 factor[number] factor number 1 return factor factor number number A, B = map(int, input().split()) A map(int, input().split()) map int input().split() ().split () input split B f = factrization_prime(gcd(A,B)) f factrization_prime(gcd(A,B)) factrization_prime gcd(A,B) gcd A B print(len(f)+1) print len(f)+1 len(f) len f 1 f = factrization_prime(gcd(A,B)) factrization_prime(gcd(A,B)) f A, B = map(int, input().split()) map(int, input().split()) A def factrization_prime(number):
    factor = {}
    div = 2
    s = sqrt(number)
    while div < s:
        div_cnt = 0
        while number % div == 0:
            div_cnt += 1
            number //= div
        if div_cnt != 0:
            factor[div] = div_cnt
        div += 1
    if number > 1:
        factor[number] = 1
    return factor def factrization_prime(number):
    factor = {}
    div = 2
    s = sqrt(number)
    while div < s:
        div_cnt = 0
        while number % div == 0:
            div_cnt += 1
            number //= div
        if div_cnt != 0:
            factor[div] = div_cnt
        div += 1
    if number > 1:
        factor[number] = 1
    return factor factrization_prime B = map(int, input().split()) map(int, input().split()) B
from math import*
def factrization_prime(number):
    factor = {}
    div = 2
    s = sqrt(number)
    while div < s:
        div_cnt = 0
        while number % div == 0:
            div_cnt += 1
            number //= div
        if div_cnt != 0:
            factor[div] = div_cnt
        div += 1
    if number > 1:
        factor[number] = 1
    return factor
A, B = map(int, input().split())
f = factrization_prime(gcd(A,B))
print(len(f)+1)
