C,D = [int(e) for e in input().split()]



if C <= D:

    m = D

    n = C

else:

    m = C

    n = D



while  n != 0 :

    a = m%n

    m = n

    n = a



J = []



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

    if m % i == 0:

        J.append(i)

        if i != m//i:

            J.append(m//i)





J.sort()



N = int(len(J))

M = [1]

I = []



for i in range(1,N):

    for p in range(1,int(J[i]**0.5)+1):

        if J[i]%p == 0:

            I.extend([J[i]])

            if int(len(I)) >=2:

                break

    if int(len(I)) == 1:

        M.extend([J[i]])

    I = []





M = int(len(M))



print(M)
C,D = [int(e) for e in input().split()]



if C <= D:

    m = D

    n = C

else:

    m = C

    n = D



while  n != 0 :

    a = m%n

    m = n

    n = a



J = []



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

    if m % i == 0:

        J.append(i)

        if i != m//i:

            J.append(m//i)





J.sort()



N = int(len(J))

M = [1]



for i in range(1,N):

    cnt = 0

    for p in range(1,int(J[i]**0.5)+1):

        if J[i]%p == 0:

            cnt += 1

            if cnt >=2:

                break

    if cnt == 1:

        M.extend([J[i]])





M = int(len(M))



print(M)
C, D = [int(e) for e in input().split()]
if C <= D:
    m = D
    n = C
else:
    m = C
    n = D
while n != 0:
    a = m % n
    m = n
    n = a
J = []
for i in range(1, int(m**0.5) + 1):
    if m % i == 0:
        J.append(i)
        if i != m // i:
            J.append(m // i)
J.sort()
N = int(len(J))
M = [1]
I = []
for i in range(1, N):
    for p in range(1, int(J[i] ** 0.5) + 1):
        if J[i] % p == 0:
            I.extend([J[i]])
            if int(len(I)) >= 2:
                break
    if int(len(I)) == 1:
        M.extend([J[i]])
    I = []
M = int(len(M))
print(M)

C, D = [int(e) for e in input().split()]
if C <= D:
    m = D
    n = C
else:
    m = C
    n = D
while n != 0:
    a = m % n
    m = n
    n = a
J = []
for i in range(1, int(m**0.5) + 1):
    if m % i == 0:
        J.append(i)
        if i != m // i:
            J.append(m // i)
J.sort()
N = int(len(J))
M = [1]
for i in range(1, N):
    cnt = 0
    for p in range(1, int(J[i] ** 0.5) + 1):
        if J[i] % p == 0:
            cnt += 1
            if cnt >= 2:
                break
    if cnt == 1:
        M.extend([J[i]])
M = int(len(M))
print(M)

-I = [] +    cnt = 0 -            I.extend([J[i]]) -            if int(len(I)) >= 2: +            cnt += 1 +            if cnt >= 2: -    if int(len(I)) == 1: +    if cnt == 1: -    I = []