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

def make_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)
    return divisors

def primes(n):
    sieve = [True] * (n//2)
    for i in range(3,int(n**0.5)+1,2):
        if sieve[i//2]:
            sieve[i*i//2::i] = [False] * ((n-i*i-1)//(2*i)+1)
    return [1, 2] + [2*i+1 for i in range(1,n//2) if sieve[i]]

a, b = map(int, input().split())
l = [i for i, j in collections.Counter(make_divisors(a) + make_divisors(b)).items() if j > 1]
p = collections.defaultdict(int)
if not l:
    print(0)
    exit()
for i in primes(l[-1]+1): p[i] = 1
print(len([x for x in l if p.get(x)]))

Fixed submission:
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

a, b = map(int, input().split())
print(len(set(prime_factorize(a)) & set(prime_factorize(b)))+1)

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

def make_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)
    return divisors

def primes(n):
    sieve = [True] * (n//2)
    for i in range(3,int(n**0.5)+1,2):
        if sieve[i//2]:
            sieve[i*i//2::i] = [False] * ((n-i*i-1)//(2*i)+1)
    return [1, 2] + [2*i+1 for i in range(1,n//2) if sieve[i]]

a, b = map(int, input().split())
l = [i for i, j in collections.Counter(make_divisors(a) + make_divisors(b)).items() if j > 1]
p = {}
if not l:
    print(0)
    exit()
for i in primes(l[-1]+1): p[i] = 1
print(len([x for x in l if p.get(x)]))

Fixed submission:
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

a, b = map(int, input().split())
print(len(set(prime_factorize(a)) & set(prime_factorize(b)))+1)

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

def make_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)
    return divisors

def primes(n):
    sieve = [True] * (n//2)
    for i in range(3,int(n**0.5)+1,2):
        if sieve[i//2]:
            sieve[i*i//2::i] = [False] * ((n-i*i-1)//(2*i)+1)
    return [2] + [2*i+1 for i in range(1,n//2) if sieve[i]]

a, b = map(int, input().split())
l = [i for i, j in collections.Counter(make_divisors(a) + make_divisors(b)).items() if j > 1]
p = {}
for i in primes(l[-1]+1): p[i] = 1
print(1+len([x for x in l if p.get(x)]))

Fixed submission:
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

a, b = map(int, input().split())
print(len(set(prime_factorize(a)) & set(prime_factorize(b)))+1)