import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

a, b = map(int, input().split())
_min, _max = min(a, b), max(a, b)
prime_factors = []
i = 2
while i ** 2 <= _min:
    ext = 0
    while _min % i == 0:
        ext += 1
        _min //= i
    if ext:
        prime_factors.append((i, ext))
    i += 1
if _min != 1:
    prime_factors.append((_min, 1))

ans = 1
for pf, _ in prime_factors:
    if _max % pf == 0:
        ans += 1
print(ans) import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline sys.setrecursionlimit(10 ** 7) sys.setrecursionlimit sys setrecursionlimit 10 ** 7 10 7 a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b _min, _max = min(a, b), max(a, b) _min min(a, b) min a b _max max(a, b) max a b prime_factors = [] prime_factors [] i = 2 i 2 while i ** 2 <= _min:
    ext = 0
    while _min % i == 0:
        ext += 1
        _min //= i
    if ext:
        prime_factors.append((i, ext))
    i += 1 i ** 2 <= _min i ** 2 i 2 _min ext = 0 ext 0 while _min % i == 0:
        ext += 1
        _min //= i
     _min % i == 0 _min % i _min i 0 ext += 1 ext 1 _min //= i _min i if ext:
        prime_factors.append((i, ext))
     ext prime_factors.append((i, ext)) prime_factors.append prime_factors append (i, ext) i ext i += 1 i 1 if _min != 1:
    prime_factors.append((_min, 1)) _min != 1 _min 1 prime_factors.append((_min, 1)) prime_factors.append prime_factors append (_min, 1) _min 1 ans = 1 ans 1 for pf, _ in prime_factors:
    if _max % pf == 0:
        ans += 1 pf _ prime_factors if _max % pf == 0:
        ans += 1 _max % pf == 0 _max % pf _max pf 0 ans += 1 ans 1 print(ans) print ans b = map(int, input().split()) map(int, input().split()) b ans = 1 1 ans ans += 1 1 ans a, b = map(int, input().split()) map(int, input().split()) a input = sys.stdin.readline sys.stdin.readline input _min //= i i _min _max = min(a, b), max(a, b) max(a, b) _max i += 1 1 i _min, _max = min(a, b), max(a, b) min(a, b) _min prime_factors = [] [] prime_factors ext += 1 1 ext i = 2 2 i ext = 0 0 ext
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

a, b = map(int, input().split())
_min, _max = min(a, b), max(a, b)
prime_factors = []
i = 2
while i ** 2 <= _min:
    ext = 0
    while _min % i == 0:
        ext += 1
        _min //= i
    if ext:
        prime_factors.append((i, ext))
    i += 1
if _min != 1:
    prime_factors.append((_min, 1))

ans = 1
for pf, _ in prime_factors:
    if _max % pf == 0:
        ans += 1
print(ans)
