Buggy python submission (verdict: Runtime Error):
import math

a,b = map(int, input().split())

list_a = []
list_b = []
sqrt_a = math.sqrt(a)
sqrt_b = math.sqrt(b)


for i in range(2, float(sqrt_a) ):  
  if (a % (i) == 0):
    list_a.append( i )
    while( a % (i) == 0 ):
      a = a//(i)
      
for i in range(2, float(sqrt_b) ):  
  if (b % (i) == 0):
    list_b.append( i )
    while( b % (i ) == 0 ):
      b = b//(i)

#print(list_a)
#print(list_b)

set_a = set(list_a)
set_b = set(list_b)

set_ab = set_a & set_b
  
print(len(set_ab) + 1)
      

Fixed submission:
import math

a,b = map(int, input().split())

list_a = []
list_b = []
sqrt_a = math.sqrt(a)
sqrt_b = math.sqrt(b)


for i in range(2, int(sqrt_a) ):  
  if (a % (i) == 0):
    list_a.append( i )
    while( a % (i) == 0 ):
      a = a//(i)
if a > 1:
  list_a.append(a)
      
for i in range(2, int(sqrt_b) ):  
  if (b % (i) == 0):
    list_b.append( i )
    while( b % (i ) == 0 ):
      b = b//(i)
if b > 1:
  list_b.append(b)

#print(list_a)
#print(list_b)

set_a = set(list_a)
set_b = set(list_b)

set_ab = set_a & set_b
  
print(len(set_ab) + 1)

Buggy python submission (verdict: Time Limit Exceeded):
a,b = map(int, input().split())

list_a = []
list_b = []


for i in range(1, a):  
  if (a % (i + 1) == 0):
    list_a.append( i +1 )
    while( a % (i + 1) == 0 ):
      a = a//(i+1)
      
for i in range(1, b):  
  if (b % (i + 1) == 0):
    list_b.append( i +1 )
    while( b % (i + 1) == 0 ):
      b = b//(i+1)

#print(list_a)
#print(list_b)

set_a = set(list_a)
set_b = set(list_b)

set_ab = set_a & set_b
  
print(len(set_ab) + 1)
      

Fixed submission:
import math

a,b = map(int, input().split())

list_a = []
list_b = []
sqrt_a = math.sqrt(a)
sqrt_b = math.sqrt(b)


for i in range(2, int(sqrt_a) ):  
  if (a % (i) == 0):
    list_a.append( i )
    while( a % (i) == 0 ):
      a = a//(i)
if a > 1:
  list_a.append(a)
      
for i in range(2, int(sqrt_b) ):  
  if (b % (i) == 0):
    list_b.append( i )
    while( b % (i ) == 0 ):
      b = b//(i)
if b > 1:
  list_b.append(b)

#print(list_a)
#print(list_b)

set_a = set(list_a)
set_b = set(list_b)

set_ab = set_a & set_b
  
print(len(set_ab) + 1)

Buggy python submission (verdict: Time Limit Exceeded):
a,b = map(int, input().split())

list_a = []
list_b = []


for i in range(1, a):  
  if (a % (i + 1) == 0):
    list_a.append( i +1 )
    while( a % (i + 1) == 0 ):
      a = a//(i+1)
      
for i in range(1, b):  
  if (b % (i + 1) == 0):
    list_b.append( i +1 )
    while( b % (i + 1) == 0 ):
      b = b//(i+1)

#print(list_a)
#print(list_b)

set_a = set(list_a)
set_b = set(list_b)

set_ab = set_a & set_b
  
print(len(set_ab) + 1)
      

Fixed submission:
import math

a,b = map(int, input().split())

list_a = []
list_b = []
sqrt_a = math.sqrt(a)
sqrt_b = math.sqrt(b)


for i in range(2, int(sqrt_a) ):  
  if (a % (i) == 0):
    list_a.append( i )
    while( a % (i) == 0 ):
      a = a//(i)
if a > 1:
  list_a.append(a)
      
for i in range(2, int(sqrt_b) ):  
  if (b % (i) == 0):
    list_b.append( i )
    while( b % (i ) == 0 ):
      b = b//(i)
if b > 1:
  list_b.append(b)

#print(list_a)
#print(list_b)

set_a = set(list_a)
set_b = set(list_b)

set_ab = set_a & set_b
  
print(len(set_ab) + 1)

Buggy python submission (verdict: Time Limit Exceeded):
a,b = map(int, input().split())

list_a = []
list_b = []


for i in range(1, a):  
  if (a % (i + 1) == 0):
    list_a.append( i +1 )
    while( a % (i + 1) == 0 ):
      a = a//(i+1)
      
for i in range(1, b):  
  if (b % (i + 1) == 0):
    list_b.append( i +1 )
    while( b % (i + 1) == 0 ):
      b = b//(i+1)

#print(list_a)
#print(list_b)

sum = 0
for i in range(len(list_a)):
  for j in range(len(list_b)):
    if list_a[i] == list_b[j]:
      sum += 1
      
print(sum + 1)
      

Fixed submission:
import math

a,b = map(int, input().split())

list_a = []
list_b = []
sqrt_a = math.sqrt(a)
sqrt_b = math.sqrt(b)


for i in range(2, int(sqrt_a) ):  
  if (a % (i) == 0):
    list_a.append( i )
    while( a % (i) == 0 ):
      a = a//(i)
if a > 1:
  list_a.append(a)
      
for i in range(2, int(sqrt_b) ):  
  if (b % (i) == 0):
    list_b.append( i )
    while( b % (i ) == 0 ):
      b = b//(i)
if b > 1:
  list_b.append(b)

#print(list_a)
#print(list_b)

set_a = set(list_a)
set_b = set(list_b)

set_ab = set_a & set_b
  
print(len(set_ab) + 1)

Buggy python submission (verdict: Time Limit Exceeded):
a, b = map(int, input().split())

#最大公約数を求める
max_val = max(a, b)
min_val = min(a, b)

while(1):
  if max_val % min_val ==0:
    break
  else:
    tmp = max_val % min_val
    max_val = min_val
    min_val = tmp
    
#print(min_val)

list = []

for i in range(1, min_val//2 + 1):
  if (min_val % i == 0):
    list.append(i)
    
list.append(min_val)

for i in range(len(list)-1,0, -1): # 1は除外
  for j in range(i-1,0,-1):
 #   print("list[i],list[j]",list[i],list[j])
    if list[i] % list[j] == 0 and list[i] > 2:
      list[i] = 0

#print(list)
for i in range(len(list)-1 ,0,-1):
  if list[i]==0:
    list.pop(i)
      
#print(list)
#sum = 0
#for i in range(len(list)):
 # for j in range(i,len(list)):
  #  if (list[j] % list[i]) == 1:
   #   sum += 1
 
print(len(list))

Fixed submission:
import math

a,b = map(int, input().split())

list_a = []
list_b = []
sqrt_a = math.sqrt(a)
sqrt_b = math.sqrt(b)


for i in range(2, int(sqrt_a) ):  
  if (a % (i) == 0):
    list_a.append( i )
    while( a % (i) == 0 ):
      a = a//(i)
if a > 1:
  list_a.append(a)
      
for i in range(2, int(sqrt_b) ):  
  if (b % (i) == 0):
    list_b.append( i )
    while( b % (i ) == 0 ):
      b = b//(i)
if b > 1:
  list_b.append(b)

#print(list_a)
#print(list_b)

set_a = set(list_a)
set_b = set(list_b)

set_ab = set_a & set_b
  
print(len(set_ab) + 1)

Buggy python submission (verdict: Time Limit Exceeded):
a, b = map(int, input().split())

#最大公約数を求める
max_val = max(a, b)
min_val = min(a, b)

while(1):
  if max_val % min_val ==0:
    break
  else:
    tmp = max_val % min_val
    max_val = min_val
    min_val = tmp
    
#print(min_val)

list = []

for i in range(1, min_val//2 + 1):
  if (min_val % i == 0):
    list.append(i)
    
list.append(min_val)

for i in range(len(list)-1,0, -1): # 1は除外
  for j in range(i-1,0,-1):
 #   print("list[i],list[j]",list[i],list[j])
    if list[i] % list[j] == 0 and list[i] > 2:
      list[i] = 0

#print(list)
for i in range(len(list)-1 ,0,-1):
  if list[i]==0:
    list.pop(i)
      
#print(list)
sum = 0
for i in range(len(list)):
  for j in range(i,len(list)):
    if (list[j] % list[i]) == 1:
      sum += 1
 
print(len(list))

Fixed submission:
import math

a,b = map(int, input().split())

list_a = []
list_b = []
sqrt_a = math.sqrt(a)
sqrt_b = math.sqrt(b)


for i in range(2, int(sqrt_a) ):  
  if (a % (i) == 0):
    list_a.append( i )
    while( a % (i) == 0 ):
      a = a//(i)
if a > 1:
  list_a.append(a)
      
for i in range(2, int(sqrt_b) ):  
  if (b % (i) == 0):
    list_b.append( i )
    while( b % (i ) == 0 ):
      b = b//(i)
if b > 1:
  list_b.append(b)

#print(list_a)
#print(list_b)

set_a = set(list_a)
set_b = set(list_b)

set_ab = set_a & set_b
  
print(len(set_ab) + 1)

Buggy python submission (verdict: Time Limit Exceeded):
a, b = map(int, input().split())

#最大公約数を求める
max_val = max(a, b)
min_val = min(a, b)

while(1):
  if max_val % min_val ==0:
    break
  else:
    tmp = max_val % min_val
    max_val = min_val
    min_val = tmp
    
#print(min_val)

list = []

for i in range(1, min_val//2 + 1):
  if (min_val % i == 0):
    list.append(i)
    
list.append(min_val)

for i in range(len(list)-1,0, -1): # 1は除外
  for j in range(i-1,0,-1):
 #   print("list[i],list[j]",list[i],list[j])
    if list[i] % list[j] == 0 and list[i] > 2:
      list[i] = 0

#print(list)
for i in range(len(list)-1 ,0,-1):
  if list[i]==0:
    list.pop(i)
      
#print(list)
sum = 0
for i in range(len(list)):
  for j in range(i,len(list)):
    if (list[j] % list[i]) == 1:
      sum += 1
 
print(len(list))

Fixed submission:
import math

a,b = map(int, input().split())

list_a = []
list_b = []
sqrt_a = math.sqrt(a)
sqrt_b = math.sqrt(b)


for i in range(2, int(sqrt_a) ):  
  if (a % (i) == 0):
    list_a.append( i )
    while( a % (i) == 0 ):
      a = a//(i)
if a > 1:
  list_a.append(a)
      
for i in range(2, int(sqrt_b) ):  
  if (b % (i) == 0):
    list_b.append( i )
    while( b % (i ) == 0 ):
      b = b//(i)
if b > 1:
  list_b.append(b)

#print(list_a)
#print(list_b)

set_a = set(list_a)
set_b = set(list_b)

set_ab = set_a & set_b
  
print(len(set_ab) + 1)