Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# Your code here!
import fractions

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

def yaku(num):
    temp=[]
    for i in range(2,-int(-num**0.5//1)+1):
        if num%i==0:
            temp.append(i)
            temp.append(num//i)
    temp=list(set(temp))
    temp.append(num)
    temp.sort()
    return temp

koyaku=fractions.gcd(A,B)

cand=yaku(min(A,B))
#print(cand)

count=0

for i in cand:
    judge=True
    while koyaku%i==0:
        koyaku//=i
        if judge==True:
            count+=1
            judge=False
    if koyaku==1:
        break
print(count+1)


Fixed submission:
# coding: utf-8
# Your code here!
import fractions

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

def yaku(num):
    temp=[]
    for i in range(2,-int(-num**0.5//1)+1):
        if num%i==0:
            temp.append(i)
            temp.append(num//i)
    temp=list(set(temp))
    if num!=2:
        temp.append(num)
    temp.sort()
    return temp

koyaku=fractions.gcd(A,B)

cand=yaku(min(A,B))
#print(cand)

if cand[0]==1:
    print(1)
    exit()

count=0

for i in cand:
    judge=True
    while koyaku%i==0:
        koyaku//=i
        if judge==True:
            count+=1
            judge=False
    if koyaku==1:
        break
print(count+1)

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# Your code here!
import fractions

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

koyaku=fractions.gcd(A,B)

num=min(A,B)
count=0

for i in range(2,num+1):
    judge=True
    while koyaku%i==0:
        koyaku//=i
        if judge==True:
            count+=1
            judge=False
    if koyaku==1:
        break
print(count+1)


Fixed submission:
# coding: utf-8
# Your code here!
import fractions

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

def yaku(num):
    temp=[]
    for i in range(2,-int(-num**0.5//1)+1):
        if num%i==0:
            temp.append(i)
            temp.append(num//i)
    temp=list(set(temp))
    if num!=2:
        temp.append(num)
    temp.sort()
    return temp

koyaku=fractions.gcd(A,B)

cand=yaku(min(A,B))
#print(cand)

if cand[0]==1:
    print(1)
    exit()

count=0

for i in cand:
    judge=True
    while koyaku%i==0:
        koyaku//=i
        if judge==True:
            count+=1
            judge=False
    if koyaku==1:
        break
print(count+1)

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# Your code here!
import fractions

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

koyaku=fractions.gcd(A,B)

num=min(A,B)
count=0

for i in range(2,num+1):
    judge=True
    while koyaku%i==0:
        koyaku//=i
        if judge==True:
            count+=1
            judge=False
    if koyaku==1:
        break
print(count+1)


Fixed submission:
# coding: utf-8
# Your code here!
import fractions

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

def yaku(num):
    temp=[]
    for i in range(2,-int(-num**0.5//1)+1):
        if num%i==0:
            temp.append(i)
            temp.append(num//i)
    temp=list(set(temp))
    if num!=2:
        temp.append(num)
    temp.sort()
    return temp

koyaku=fractions.gcd(A,B)

cand=yaku(min(A,B))
#print(cand)

if cand[0]==1:
    print(1)
    exit()

count=0

for i in cand:
    judge=True
    while koyaku%i==0:
        koyaku//=i
        if judge==True:
            count+=1
            judge=False
    if koyaku==1:
        break
print(count+1)

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# Your code here!
# coding: utf-8
# Your code here!
A,B=map(int,input().split())

def gcd (a,b):
    temp=[]
    M=max(a,b)
    m=min(a,b)
    for i in range(-int(-M**0.5//1)):
        if M%(i+1)==0:
            if m%(i+1)==0:
                temp.append(i+1)
            if m%(M//(i+1))==0:
                temp.append(M//(i+1))
    return temp

koyaku=max(gcd(A,B))

count=0
for i in range(2,koyaku+1):
    judge=True
    while koyaku%i==0 and koyaku!=1:
        koyaku//=i
        if judge==True:
            count+=1
            judge=False
print(count+1)


Fixed submission:
# coding: utf-8
# Your code here!
import fractions

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

def yaku(num):
    temp=[]
    for i in range(2,-int(-num**0.5//1)+1):
        if num%i==0:
            temp.append(i)
            temp.append(num//i)
    temp=list(set(temp))
    if num!=2:
        temp.append(num)
    temp.sort()
    return temp

koyaku=fractions.gcd(A,B)

cand=yaku(min(A,B))
#print(cand)

if cand[0]==1:
    print(1)
    exit()

count=0

for i in cand:
    judge=True
    while koyaku%i==0:
        koyaku//=i
        if judge==True:
            count+=1
            judge=False
    if koyaku==1:
        break
print(count+1)

Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!

if A*B==2:
    print(1)
    exit()

A,B=map(int,input().split())
s=[]
ans=[]
count=0
for i in range(1,-int(-A**0.5//1)+1):#因数分解
    if A%i==0:
        s.append(i)
        s.append(A//i)

for i in range(1,-int(-B**0.5//1)+1):#因数分解
    if B%i==0:
        if i in s:
            ans.append(i)
        elif B//i in s:   
            ans.append(B//i)        

ans.sort()

for i in range(1,len(ans)):
    for j in range(1,i):
        if ans[i]%ans[j]==0:
            count-=1
            break
    count+=1

print(count+1)



Fixed submission:
# coding: utf-8
# Your code here!
import fractions

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

def yaku(num):
    temp=[]
    for i in range(2,-int(-num**0.5//1)+1):
        if num%i==0:
            temp.append(i)
            temp.append(num//i)
    temp=list(set(temp))
    if num!=2:
        temp.append(num)
    temp.sort()
    return temp

koyaku=fractions.gcd(A,B)

cand=yaku(min(A,B))
#print(cand)

if cand[0]==1:
    print(1)
    exit()

count=0

for i in cand:
    judge=True
    while koyaku%i==0:
        koyaku//=i
        if judge==True:
            count+=1
            judge=False
    if koyaku==1:
        break
print(count+1)

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# Your code here!
A,B=map(int,input().split())
s=[]

for i in range(1,max(A,B)+1):#因数分解
    if A%i==0 and B%i==0:
        s.append(i)
        #print(i)
        for j in range(1,len(s)-1):
            if s[-1]%s[j]==0:
                #print(s[-1],s[j])
                s.pop(-1)
                break
s=list(set(s))
#print(s)
print(len(s))


Fixed submission:
# coding: utf-8
# Your code here!
import fractions

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

def yaku(num):
    temp=[]
    for i in range(2,-int(-num**0.5//1)+1):
        if num%i==0:
            temp.append(i)
            temp.append(num//i)
    temp=list(set(temp))
    if num!=2:
        temp.append(num)
    temp.sort()
    return temp

koyaku=fractions.gcd(A,B)

cand=yaku(min(A,B))
#print(cand)

if cand[0]==1:
    print(1)
    exit()

count=0

for i in cand:
    judge=True
    while koyaku%i==0:
        koyaku//=i
        if judge==True:
            count+=1
            judge=False
    if koyaku==1:
        break
print(count+1)