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

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
  
def is_prime(n):
  for p in range(2, n):
    if n % p == 0:
      return False
  return True

cnt = 0

def divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors
  
list = divisors(gcd(a,b))
for i in list:
  if is_prime(i):
    cnt += 1
print(cnt)

Fixed submission:
a,b = (int(i) for i in input().split())

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
  
def is_prime(n):
  for p in range(2, n):
    if n % p == 0:
      return False
  return True

cnt = 0

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
  
list = prime_factorize(gcd(a,b))

print(len(set(list))+1)

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

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
def divisor(n): #nの約数を全て求める
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors
  
def is_prime(n):
  for p in range(2, n):
    if n % p == 0:
      return False
  return True

cnt = 0
for i in divisor(gcd(a,b)):
  if is_prime(i):
    cnt += 1
print(cnt)

Fixed submission:
a,b = (int(i) for i in input().split())

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
  
def is_prime(n):
  for p in range(2, n):
    if n % p == 0:
      return False
  return True

cnt = 0

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
  
list = prime_factorize(gcd(a,b))

print(len(set(list))+1)

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

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
def divisor(n): #nの約数を全て求める
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    return table
def is_prime(n):
  for p in range(2, n):
    if n % p == 0:
      return False
  return True
cnt = 0
for i in divisor(gcd(a,b)):
  if is_prime(i):
    cnt += 1
print(cnt)

Fixed submission:
a,b = (int(i) for i in input().split())

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
  
def is_prime(n):
  for p in range(2, n):
    if n % p == 0:
      return False
  return True

cnt = 0

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
  
list = prime_factorize(gcd(a,b))

print(len(set(list))+1)

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

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
def divisor(n): #nの約数を全て求める
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    return table
def is_prime(n):
  for p in range(2, n):
    if n % p == 0:
      return False
  return True
cnt = 0
for i in divisor(gcd(a,b)):
  if is_prime(i):
    cnt += 1
print(cnt)

Fixed submission:
a,b = (int(i) for i in input().split())

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
  
def is_prime(n):
  for p in range(2, n):
    if n % p == 0:
      return False
  return True

cnt = 0

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
  
list = prime_factorize(gcd(a,b))

print(len(set(list))+1)