import fractions

import collections

A,B = list(map(int,input().split()))

p = fractions.gcd(A,B)

#print(p)

num = []

for i in range(2,int(p**0.5)+1):

    while p%i==0:

        num.append(i)

        p //= i

if p != 1:

    num.append(p)

#print(num)

pp = collections.Counter(num)

print((len(pp)+1))
A,B = list(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))
import fractions
import collections

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

A, B = list(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))

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