Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8

def divisors(n):
    for i in range(2, n+1):
        if n % i == 0:
            yield i

def main():
    a, b = input().split()
    a, b = int(a), int(b)

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

    if b > a:
        a, b = b, a
	
    relative_primes = []
    for div in divisors(b):
        if a % div != 0:
            continue
        flg = True
        for rp in relative_primes:
            if div % rp == 0:
                flg = False
                continue
        if flg:
            relative_primes.append(div)
    print(len(relative_primes)+1)
    

main()


Fixed submission:
# coding: utf-8

def greatest_common_divisor(N, M):
    assert N >= M
    while M != 0:
        N, M = M, N%M
    return N

def prime_divisor(N):
    temp = N
    for n in range(2, int(-(-N**0.5//1))+1):
        if temp % n == 0:
            while temp % n == 0:
                temp //= n
            yield n
    if temp != 1:
        yield temp
        

def main():
    a, b = input().split()
    a, b = int(a), int(b)

    if a > b:
        a, b = b, a

    gcd = greatest_common_divisor(b, a)
    pdiv = [pd for pd in prime_divisor(gcd)]
    print(len(pdiv)+1)

main()

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8

def greatest_common_divisor(a, b):
    assert a >= b
    while b != 0:
        a, b = b, a%b
    return a

def main():
    a, b = input().split()
    a, b = int(a), int(b)

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

    if b > a:
        a, b = b, a

    relative_primes = []
    gcd = greatest_common_divisor(a, b)
    for i in range(2, gcd+1):
        if gcd % i > 0:
            continue
            
        flg = True
        for rp in relative_primes:
            if i % rp == 0:
                flg = False
                continue
        if flg:
            relative_primes.append(i)
    print(len(relative_primes)+1)
    

main()

Fixed submission:
# coding: utf-8

def greatest_common_divisor(N, M):
    assert N >= M
    while M != 0:
        N, M = M, N%M
    return N

def prime_divisor(N):
    temp = N
    for n in range(2, int(-(-N**0.5//1))+1):
        if temp % n == 0:
            while temp % n == 0:
                temp //= n
            yield n
    if temp != 1:
        yield temp
        

def main():
    a, b = input().split()
    a, b = int(a), int(b)

    if a > b:
        a, b = b, a

    gcd = greatest_common_divisor(b, a)
    pdiv = [pd for pd in prime_divisor(gcd)]
    print(len(pdiv)+1)

main()

Buggy python submission (verdict: Runtime Error):
# coding: utf-8

def greatest_common_divisor(a, b):
    assert a > b
    while b != 0:
        a, b = b, a%b
    return a

def main():
    a, b = input().split()
    a, b = int(a), int(b)

    if b > a:
        a, b = b, a

    relative_primes = []
    gcd = greatest_common_divisor(a, b)
    for i in range(2, gcd+1):
        if gcd % i > 0:
            continue
            
        flg = True
        for rp in relative_primes:
            if i % rp == 0:
                flg = False
                continue
        if flg:
            relative_primes.append(i)
    print(len(relative_primes)+1)
    

main()

Fixed submission:
# coding: utf-8

def greatest_common_divisor(N, M):
    assert N >= M
    while M != 0:
        N, M = M, N%M
    return N

def prime_divisor(N):
    temp = N
    for n in range(2, int(-(-N**0.5//1))+1):
        if temp % n == 0:
            while temp % n == 0:
                temp //= n
            yield n
    if temp != 1:
        yield temp
        

def main():
    a, b = input().split()
    a, b = int(a), int(b)

    if a > b:
        a, b = b, a

    gcd = greatest_common_divisor(b, a)
    pdiv = [pd for pd in prime_divisor(gcd)]
    print(len(pdiv)+1)

main()

Buggy python submission (verdict: Runtime Error):
# coding: utf-8
from math import gcd
import math

def main():
    a, b = input().split()
    a, b = int(a), int(b)

    if b > a:
        a, b = b, a

    relative_primes = []
    greatest_cd = gcd(a, b)
    for i in range(2, greatest_cd+1):
        if greatest_cd % i > 0:
            continue
            
        flg = True
        for rp in relative_primes:
            if i % rp == 0:
                flg = False
                continue
        if flg:
            relative_primes.append(i)
    print(len(relative_primes)+1)
    

main()

Fixed submission:
# coding: utf-8

def greatest_common_divisor(N, M):
    assert N >= M
    while M != 0:
        N, M = M, N%M
    return N

def prime_divisor(N):
    temp = N
    for n in range(2, int(-(-N**0.5//1))+1):
        if temp % n == 0:
            while temp % n == 0:
                temp //= n
            yield n
    if temp != 1:
        yield temp
        

def main():
    a, b = input().split()
    a, b = int(a), int(b)

    if a > b:
        a, b = b, a

    gcd = greatest_common_divisor(b, a)
    pdiv = [pd for pd in prime_divisor(gcd)]
    print(len(pdiv)+1)

main()

Buggy python submission (verdict: Runtime Error):
# coding: utf-8
import math

def main():
    a, b = input().split()
    a, b = int(a), int(b)

    if b > a:
        a, b = b, a

    gcd = math.gcd(a, b)
    relative_primes = []
    for i in range(2, gcd+1):
        if gcd % i > 0:
            continue
            
        flg = True
        for rp in relative_primes:
            if i % rp == 0:
                flg = False
                continue
        if flg:
            relative_primes.append(i)
    print(len(relative_primes)+1)
    

main()

Fixed submission:
# coding: utf-8

def greatest_common_divisor(N, M):
    assert N >= M
    while M != 0:
        N, M = M, N%M
    return N

def prime_divisor(N):
    temp = N
    for n in range(2, int(-(-N**0.5//1))+1):
        if temp % n == 0:
            while temp % n == 0:
                temp //= n
            yield n
    if temp != 1:
        yield temp
        

def main():
    a, b = input().split()
    a, b = int(a), int(b)

    if a > b:
        a, b = b, a

    gcd = greatest_common_divisor(b, a)
    pdiv = [pd for pd in prime_divisor(gcd)]
    print(len(pdiv)+1)

main()