A,B = map(int,input().split())
from fractions import gcd
C = gcd(A,B)
num = []
for i in range(2,int(C**0.5)+1):
    while C%i==0:
        num.append(i)
        C //= i
if C != 1:
    num.append(C)
from collections import Counter
CC = Counter(num)
print(len(CC)+1) A,B = map(int,input().split()) A map(int,input().split()) map int input().split() ().split () input split B from fractions import gcd C = gcd(A,B) C gcd(A,B) gcd A B num = [] num [] for i in range(2,int(C**0.5)+1):
    while C%i==0:
        num.append(i)
        C //= i i range(2,int(C**0.5)+1) range 2 int(C**0.5)+1 int(C**0.5) int C**0.5 C 0.5 1 while C%i==0:
        num.append(i)
        C //= i C%i==0 C%i C i 0 num.append(i) num.append num append i C //= i C i if C != 1:
    num.append(C) C != 1 C 1 num.append(C) num.append num append C from collections import Counter CC = Counter(num) CC Counter(num) Counter num print(len(CC)+1) print len(CC)+1 len(CC) len CC 1 num = [] [] num B = map(int,input().split()) map(int,input().split()) B C //= i i C CC = Counter(num) Counter(num) CC C = gcd(A,B) gcd(A,B) C A,B = map(int,input().split()) map(int,input().split()) A
A,B = map(int,input().split())
from fractions import gcd
C = gcd(A,B)
num = []
for i in range(2,int(C**0.5)+1):
    while C%i==0:
        num.append(i)
        C //= i
if C != 1:
    num.append(C)
from collections import Counter
CC = Counter(num)
print(len(CC)+1)