import math
ab = [int(i) for i in input().split()]
ab = math.gcd(ab[0], ab[1])
dic = {}
n = 2
while n**2 <= ab:
  if ab % n:
    n += 1
  else:
    ab //= n
    dic[n] = dic.get(n,0) + 1
if 1 < ab:
  dic[ab] = dic.get(ab,0) + 1

print(len(dic) + 1) import math math int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i ab = [int(i) for i in input().split()] ab [int(i) for i in input().split()] ab = math.gcd(ab[0], ab[1]) ab math.gcd(ab[0], ab[1]) math.gcd math gcd ab[0] ab 0 ab[1] ab 1 dic = {} dic {} n = 2 n 2 while n**2 <= ab:
  if ab % n:
    n += 1
  else:
    ab //= n
    dic[n] = dic.get(n,0) + 1 n**2 <= ab n**2 n 2 ab if ab % n:
    n += 1
  else:
    ab //= n
    dic[n] = dic.get(n,0) + 1 ab % n ab n n += 1 n 1 ab //= n ab n dic[n] = dic.get(n,0) + 1 dic[n] dic n dic.get(n,0) + 1 dic.get(n,0) dic.get dic get n 0 1 if 1 < ab:
  dic[ab] = dic.get(ab,0) + 1 1 < ab 1 ab dic[ab] = dic.get(ab,0) + 1 dic[ab] dic ab dic.get(ab,0) + 1 dic.get(ab,0) dic.get dic get ab 0 1 print(len(dic) + 1) print len(dic) + 1 len(dic) len dic 1 dic = {} {} dic ab = [int(i) for i in input().split()] [int(i) for i in input().split()] ab n = 2 2 n n += 1 1 n ab = math.gcd(ab[0], ab[1]) math.gcd(ab[0], ab[1]) ab ab //= n n ab
import math
ab = [int(i) for i in input().split()]
ab = math.gcd(ab[0], ab[1])
dic = {}
n = 2
while n**2 <= ab:
  if ab % n:
    n += 1
  else:
    ab //= n
    dic[n] = dic.get(n,0) + 1
if 1 < ab:
  dic[ab] = dic.get(ab,0) + 1

print(len(dic) + 1)