Buggy python submission (verdict: Time Limit Exceeded):
import math
A,B = map(int, input().split())

# 最大公約数の算出
y = max(A,B)
x = min(A,B)
while y%x != 0:
  tmp = x
  x = y%x
  y = tmp

# 素因数分解
n = 2
p = []
while x != 1:
  if x % n == 0:
    x /= n
    p.append(n)
  else:
    n += 1
p.append(int(x))
p = list(set(p))
print(len(p))
  
  


Fixed submission:
import math
A,B = map(int, input().split())

# 最大公約数の算出
y = max(A,B)
x = min(A,B)
while y%x != 0:
  tmp = x
  x = y%x
  y = tmp

# 素因数分解
p = []
tmp = int(math.sqrt(x))+1
for n in range(2,tmp):
  while x % n == 0:
    x /= n
    p.append(n)
p.append(int(x))
p.append(1)
p = list(set(p))
print(len(p))

Buggy python submission (verdict: Time Limit Exceeded):
import math
A,B = map(int, input().split())

y = max(A,B)
x = min(A,B)
while y%x != 0:
  tmp = x
  x = y%x
  y = tmp

p = [1]
for val in range(2,x+1):
  flag = 1
  if val == 2 and x % val == 0:
    p.append(val)
  elif val % 2 != 0 and x % val == 0:
    for i in range(2,int(math.sqrt(val))+1):
      if val % i == 0:
        flag = 0
        break
    if flag == 1:
      p.append(val)
print(len(p))
  

Fixed submission:
import math
A,B = map(int, input().split())

# 最大公約数の算出
y = max(A,B)
x = min(A,B)
while y%x != 0:
  tmp = x
  x = y%x
  y = tmp

# 素因数分解
p = []
tmp = int(math.sqrt(x))+1
for n in range(2,tmp):
  while x % n == 0:
    x /= n
    p.append(n)
p.append(int(x))
p.append(1)
p = list(set(p))
print(len(p))

Buggy python submission (verdict: Time Limit Exceeded):
import math
A,B = map(int, input().split())

y = max(A,B)
x = min(A,B)
while y%x != 0:
  tmp = x
  x = y%x
  y = tmp

p = [1]
for val in range(2,x+1):
  flag = 1
  if x % val == 0:
    for i in range(2,int(math.sqrt(val))+1):
      if val % i == 0:
        flag = 0
        break
    if flag == 1:
      p.append(val)
print(len(p))
  

Fixed submission:
import math
A,B = map(int, input().split())

# 最大公約数の算出
y = max(A,B)
x = min(A,B)
while y%x != 0:
  tmp = x
  x = y%x
  y = tmp

# 素因数分解
p = []
tmp = int(math.sqrt(x))+1
for n in range(2,tmp):
  while x % n == 0:
    x /= n
    p.append(n)
p.append(int(x))
p.append(1)
p = list(set(p))
print(len(p))

Buggy python submission (verdict: Time Limit Exceeded):
import math
A,B = map(int, input().split())

y = max(A,B)
x = min(A,B)
while y%x != 0:
  tmp = x
  x = y%x
  y = tmp
#print(x)

p = [1]
for val in range(2,x+1):
  flag = 1
  if x % val == 0:
    for i in range(2,int(math.sqrt(val))+1):
      if val % i == 0:
        flag = 0
    if flag == 1:
      p.append(val)
print(len(p))

  
  

Fixed submission:
import math
A,B = map(int, input().split())

# 最大公約数の算出
y = max(A,B)
x = min(A,B)
while y%x != 0:
  tmp = x
  x = y%x
  y = tmp

# 素因数分解
p = []
tmp = int(math.sqrt(x))+1
for n in range(2,tmp):
  while x % n == 0:
    x /= n
    p.append(n)
p.append(int(x))
p.append(1)
p = list(set(p))
print(len(p))

Buggy python submission (verdict: Time Limit Exceeded):
import math
A,B = map(int, input().split())

y = max(A,B)
x = min(A,B)
while y%x != 0:
  tmp = x
  x = y%x
  y = tmp
#print(x)

p = [1,2]
for val in range(3,x+1):
  flag = 1
  for i in range(2,int(math.sqrt(val))+1):
    if val % i == 0:
      flag = 0
  if flag == 1:
    p.append(val)
out = []
for i in range(len(p)):
  if x%p[i] == 0:
    out.append(p[i])
print(len(out))
  
  

Fixed submission:
import math
A,B = map(int, input().split())

# 最大公約数の算出
y = max(A,B)
x = min(A,B)
while y%x != 0:
  tmp = x
  x = y%x
  y = tmp

# 素因数分解
p = []
tmp = int(math.sqrt(x))+1
for n in range(2,tmp):
  while x % n == 0:
    x /= n
    p.append(n)
p.append(int(x))
p.append(1)
p = list(set(p))
print(len(p))