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