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

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def cf(x1,x2):
    cf=[]
    for i in range(1,gcd(x1,x2)+1):
        if x1 % i == 0 and x2 % i == 0:
            cf.append(i)
    return cf

def is_prime(z):
  for i in range(2,int(z**0.5)+1):
    if i*i > z:
      break
    if z % i == 0:
      return False
  return True

tmp=cf(a,b)
sum=0
y=[]
for k in tmp:
  if is_prime(k):
    sum += 1

print(sum)

Fixed submission:
a,b=list(map(int,input().split()))

def cf(x1,x2):
    cf=[]
    n =max(x1,x2)
    m=min(x1,x2)
    for i in range(1,int(m**0.5)+1):
        if m % i == 0:
          if n % i == 0:
            cf.append(i)
          if i != m//i and n % (m//i) == 0:
            cf.append(m//i)
    return cf

def is_prime(z):
  for i in range(2,int(z**0.5)+1):
    if i*i > z:
      break
    if z % i == 0:
      return False
  return True

tmp=cf(a,b)
sum=0
y=[]
for k in tmp:
  if is_prime(k):
    sum += 1

print(sum)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
a,b=list(map(int,input().split()))

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def cf(x1,x2):
    cf=[]
    for i in range(1,gcd(x1,x2)+1):
        if x1 % i == 0 and x2 % i == 0:
            cf.append(i)
    return cf

def di(z,y):
  for i in range(len(y)):
    if y[i] != 1 and z % y[i] == 0:
      return False
  for i in range(2,int(np.sqrt(z))+1):
    if z % i == 0:
      return False
  return True

tmp=cf(a,b)
sum=0
y=[]
for j in range(len(tmp)):
  if di(tmp[j],y):
    y.append(tmp[j])
    sum += 1

print(sum)

Fixed submission:
a,b=list(map(int,input().split()))

def cf(x1,x2):
    cf=[]
    n =max(x1,x2)
    m=min(x1,x2)
    for i in range(1,int(m**0.5)+1):
        if m % i == 0:
          if n % i == 0:
            cf.append(i)
          if i != m//i and n % (m//i) == 0:
            cf.append(m//i)
    return cf

def is_prime(z):
  for i in range(2,int(z**0.5)+1):
    if i*i > z:
      break
    if z % i == 0:
      return False
  return True

tmp=cf(a,b)
sum=0
y=[]
for k in tmp:
  if is_prime(k):
    sum += 1

print(sum)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
a,b=list(map(int,input().split()))

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def cf(x1,x2):
    cf=[]
    for i in range(1,gcd(x1,x2)+1):
        if x1 % i == 0 and x2 % i == 0:
            cf.append(i)
    return cf

def di(z):
  for i in range(2,int(np.sqrt(z))+1):
    if z % i == 0:
      return False
  return True

tmp=cf(a,b)
sum=0
for j in range(len(tmp)):
  if di(tmp[j]):
    sum += 1

print(sum)

Fixed submission:
a,b=list(map(int,input().split()))

def cf(x1,x2):
    cf=[]
    n =max(x1,x2)
    m=min(x1,x2)
    for i in range(1,int(m**0.5)+1):
        if m % i == 0:
          if n % i == 0:
            cf.append(i)
          if i != m//i and n % (m//i) == 0:
            cf.append(m//i)
    return cf

def is_prime(z):
  for i in range(2,int(z**0.5)+1):
    if i*i > z:
      break
    if z % i == 0:
      return False
  return True

tmp=cf(a,b)
sum=0
y=[]
for k in tmp:
  if is_prime(k):
    sum += 1

print(sum)