import sys
import math

stdin = sys.stdin

nm = lambda: map(int, stdin.readline().split())

a, b = nm()

n = math.gcd(a,b)

count = 1 # 1
for i in range(2, int(n**(1/2))+1):
    if n%i ==0:
        count +=1
        while n%i == 0:
            n = n/i
    if n ==1:
        break
if n != 1:
    count += 1

print(count) import sys sys import math math stdin = sys.stdin stdin sys.stdin sys stdin nm = lambda: map(int, stdin.readline().split()) nm lambda: map(int, stdin.readline().split()) map(int, stdin.readline().split()) map int stdin.readline().split() stdin.readline().split stdin.readline() stdin.readline stdin readline split a, b = nm() a nm() nm b n = math.gcd(a,b) n math.gcd(a,b) math.gcd math gcd a b count = 1 count 1 for i in range(2, int(n**(1/2))+1):
    if n%i ==0:
        count +=1
        while n%i == 0:
            n = n/i
    if n ==1:
        break i range(2, int(n**(1/2))+1) range 2 int(n**(1/2))+1 int(n**(1/2)) int n**(1/2) n 1/2 1 2 1 if n%i ==0:
        count +=1
        while n%i == 0:
            n = n/i
     n%i ==0 n%i n i 0 count +=1 count 1 while n%i == 0:
            n = n/i
     n%i == 0 n%i n i 0 n = n/i n n/i n i if n ==1:
        break n ==1 n 1 break if n != 1:
    count += 1 n != 1 n 1 count += 1 count 1 print(count) print count stdin = sys.stdin sys.stdin stdin count = 1 1 count nm = lambda: map(int, stdin.readline().split()) lambda: map(int, stdin.readline().split()) nm count += 1 1 count n = n/i n/i n count +=1 1 count n = math.gcd(a,b) math.gcd(a,b) n a, b = nm() nm() a b = nm() nm() b
import sys
import math

stdin = sys.stdin

nm = lambda: map(int, stdin.readline().split())

a, b = nm()

n = math.gcd(a,b)

count = 1 # 1
for i in range(2, int(n**(1/2))+1):
    if n%i ==0:
        count +=1
        while n%i == 0:
            n = n/i
    if n ==1:
        break
if n != 1:
    count += 1

print(count)