Buggy python submission (verdict: Time Limit Exceeded):

from sys import stdin
import math

a,b = [int(x) for x in stdin.readline().rstrip().split()]
 
def is_prime(n):
    if n == 1: return False
    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False
    return True
 
if a == 1:
    print(1)
    exit()
 
def cf(x1,x2):
    cf=[]
    cf.append(1)
    k = min(x1,x2)
    for i in range(2,k+1):
        if is_prime(i) == True:
            if x1 % i == 0 and x2 % i == 0:
                cf.append(i)
    return len(cf)
 
print(cf(a,b))

Fixed submission:
from sys import stdin
import fractions
import bisect

a,b = [int(x) for x in stdin.readline().rstrip().split()]

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

ali = set(prime_factorize(a))
bli = set(prime_factorize(b))

ali = list(ali)
bli = list(bli)

point = 0
for i in range(len(ali)):
    if ali[i] in bli:
        point += 1
print(point+1)

Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin
import math

a,b = [int(x) for x in stdin.readline().rstrip().split()]

def is_prime(n):
    if n == 1: return False
    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False
    return True

if a == 1:
    print(1)
    exit()

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

print(cf(a,b))

Fixed submission:
from sys import stdin
import fractions
import bisect

a,b = [int(x) for x in stdin.readline().rstrip().split()]

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

ali = set(prime_factorize(a))
bli = set(prime_factorize(b))

ali = list(ali)
bli = list(bli)

point = 0
for i in range(len(ali)):
    if ali[i] in bli:
        point += 1
print(point+1)

Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin
import itertools
import math

a,b = [int(x) for x in stdin.readline().rstrip().split()]

def isPrime(n):
  if n < 2:
    return False
  if n == 2:
    return True
  for p in range(2, n):
      if n % p == 0:
        return False
  return True

if a == 1:
    print(1)
    exit()

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

li2 = list(itertools.combinations(cf(a,b),2))
flat = [flatten for inner in li2 for flatten in inner]
print(len(list(set(flat))))

Fixed submission:
from sys import stdin
import fractions
import bisect

a,b = [int(x) for x in stdin.readline().rstrip().split()]

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

ali = set(prime_factorize(a))
bli = set(prime_factorize(b))

ali = list(ali)
bli = list(bli)

point = 0
for i in range(len(ali)):
    if ali[i] in bli:
        point += 1
print(point+1)