Buggy python submission (verdict: Time Limit Exceeded):
A,B=map(int,input().split())
lst=set()
i=2
while i<=A or i<=B:
    #print(i,A,B,lst)
    if A%i==0 and B%i==0:
        flag=1
        for l in lst:
            if i%l==0:
                flag=0
                break

        if flag:
            lst.add(i)
        while A%i==0:
            A=A//i
        while B%i==0:
            B=B//i
    i+=1


lst.add(1)
#print(lst)
print(len(lst))


Fixed submission:
A,B=map(int,input().split())
lst=set()
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

if A==B==1:
    print(1)
else:
    print(len(set([i[0] for i in factorization(A)])&set([i[0] for i in factorization(B)]))+1)

Buggy python submission (verdict: Time Limit Exceeded):
A,B=map(int,input().split())
lst=set()
i=2
while i<=A and i<=B:
    #print(i,A,B,lst)
    if A%i==0 and B%i==0:
        flag=1
        for l in lst:
            if i%l==0:
                flag=0
                break

        if flag:
            lst.add(i)
        while A%i==0:
            A=A//i
        while B%i==0:
            B=B//i    
    i+=1


lst.add(1)
#print(lst)
print(len(lst))


Fixed submission:
A,B=map(int,input().split())
lst=set()
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

if A==B==1:
    print(1)
else:
    print(len(set([i[0] for i in factorization(A)])&set([i[0] for i in factorization(B)]))+1)

Buggy python submission (verdict: Time Limit Exceeded):
A,B=map(int,input().split())
lst=set()
i=2
while i<=A and i<=B:
    #print(i,A,B,lst)
    if A%i==0 and B%i==0:
        flag=1
        for l in lst:
            if i%l==0:
                flag=0
                break
        A=A//i
        B=B//i
        if flag:
            lst.add(i)
    i+=1


lst.add(1)
#print(lst)
print(len(lst))


Fixed submission:
A,B=map(int,input().split())
lst=set()
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

if A==B==1:
    print(1)
else:
    print(len(set([i[0] for i in factorization(A)])&set([i[0] for i in factorization(B)]))+1)

Buggy python submission (verdict: Runtime Error):
A,B=map(int,input().split())
lst=[]
i=2
while A>1 and B>1:
    if A%i==0 and B%i==0:
        flag=1
        for l in lst:
            if i%l==0:
                flag=0
                break
        if flag:
            A=A//i
            B=B//i
            lst.append(i)
    if not flag:
        i+=1

lst+=[1]
#print(lst)
print(len(lst))


Fixed submission:
A,B=map(int,input().split())
lst=set()
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

if A==B==1:
    print(1)
else:
    print(len(set([i[0] for i in factorization(A)])&set([i[0] for i in factorization(B)]))+1)

Buggy python submission (verdict: Time Limit Exceeded):
A,B=map(int,input().split())
lst=[]
i=2
while A>1 and B>1:
    if A%i==0 and B%i==0:
        flag=1
        for l in lst:
            if i%l==0:
                flag=0
                break
        if flag:
            A=A//i
            B=B//i
            lst.append(i)
    i+=1

lst+=[1]
#print(lst)
print(len(lst))


Fixed submission:
A,B=map(int,input().split())
lst=set()
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

if A==B==1:
    print(1)
else:
    print(len(set([i[0] for i in factorization(A)])&set([i[0] for i in factorization(B)]))+1)

Buggy python submission (verdict: Runtime Error):
A,B=map(int,input().split())
lst=[]
i=2
while A>1 and B>1
    if A%i==0 and B%i==0:
        flag=1
        for l in lst:
            if i%l==0:
                flag=0
                break
        if flag:
            A=A//i
            B=B//i
            lst.append(i)
    i+=1

lst+=[1]
#print(lst)
print(len(lst))


Fixed submission:
A,B=map(int,input().split())
lst=set()
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

if A==B==1:
    print(1)
else:
    print(len(set([i[0] for i in factorization(A)])&set([i[0] for i in factorization(B)]))+1)

Buggy python submission (verdict: Time Limit Exceeded):
A,B=map(int,input().split())
lst=[]
for i in range(2,int(min(A,B)+1)):
    if A%i==0 and B%i==0:
        flag=1
        for l in lst:
            if i%l==0:
                flag=0
                break
        if flag:
            A=A//i
            B=B//i
            lst.append(i)

lst+=[1]
#print(lst)
print(len(lst))


Fixed submission:
A,B=map(int,input().split())
lst=set()
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

if A==B==1:
    print(1)
else:
    print(len(set([i[0] for i in factorization(A)])&set([i[0] for i in factorization(B)]))+1)

Buggy python submission (verdict: Time Limit Exceeded):
A,B=map(int,input().split())
lst=[]
for i in range(2,int(min(A,B)+1)):
    if A%i==0 and B%i==0:
        flag=1
        for l in lst:
            if i%l==0:
                flag=0
                break
        if flag:
            lst.append(i)

lst+=[1]
#print(lst)
print(len(lst))


Fixed submission:
A,B=map(int,input().split())
lst=set()
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

if A==B==1:
    print(1)
else:
    print(len(set([i[0] for i in factorization(A)])&set([i[0] for i in factorization(B)]))+1)

Buggy python submission (verdict: Time Limit Exceeded):
def kouyakusuuset(x,y):
    lst=set()
    for i in range(1,x+1):
     if x%i==0 and y%i==0:
         lst.add(i)
    return(lst)
def sosuu(x):
    lst=set()
    for i in range(2,x+1):
        flag=0
        for s in lst:
            if i%s==0:
                flag=1
        if not flag:
            lst.add(i)
    return(lst)

A,B=map(int,input().split())
if A>B:A,B=B,A
lst=kouyakusuuset(A,B)
lst=list(lst)
sosuulst=sosuu(max(lst))
print(len([1 for i in lst if i in sosuulst])+1)


Fixed submission:
A,B=map(int,input().split())
lst=set()
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

if A==B==1:
    print(1)
else:
    print(len(set([i[0] for i in factorization(A)])&set([i[0] for i in factorization(B)]))+1)

Buggy python submission (verdict: Time Limit Exceeded):
def kouyakusuuset(x,y):
    lst=set()
    for i in range(1,x+1):
     if x%i==0 and y%i==0:
         lst.add(i)
    return(lst)


A,B=map(int,input().split())
lst=kouyakusuuset(A,B)
lst=list(lst)
#print(lst)
data=[1 for i in lst]
count=0
for i in range(1,len(lst)-1):
    for m in range(i+1,len(lst)):
        if len(kouyakusuuset(lst[i],lst[m]))>=2:
            data[m]=0
#print(data)
print(len([i for i in data if i]))


Fixed submission:
A,B=map(int,input().split())
lst=set()
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

if A==B==1:
    print(1)
else:
    print(len(set([i[0] for i in factorization(A)])&set([i[0] for i in factorization(B)]))+1)