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


def solve(arg: str) -> str:
    a, b = map(int, arg.split())
    div = [1]

    g = fractions.gcd(a, b)
    n = 2
    while n <= g:
        if g % n == 0:
            div.append(n)
            while g % n == 0:
                g = int(g/n)
        n += 1
        
    return str(len(div))


if __name__ == "__main__":
    print(solve(input()))


Fixed submission:
# coding: utf-8
import fractions


def solve(arg: str) -> str:
    a, b = map(int, arg.split())
    div = [1]

    g = fractions.gcd(a, b)
    n = 2
    while n*n <= g:
        if g % n == 0:
            div.append(n)
            while g % n == 0:
                g = int(g/n)
        n += 1
    if g != 1:
        div.append(g)

    return str(len(div))


if __name__ == "__main__":
    print(solve(input()))

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


def solve(arg: str) -> str:
    a, b = map(int, arg.split())
    div = [1]
    g = fractions.gcd(a, b)
    n = 2
    while n <= g:
        if a % n == 0 and b % n == 0:
            if(all([n % m != 0 for m in div if m != 1])):
                div.append(n)
                while g % n == 0:
                    g = int(g/n)
        n += 1

    return str(len(div))


if __name__ == "__main__":
    print(solve(input()))


Fixed submission:
# coding: utf-8
import fractions


def solve(arg: str) -> str:
    a, b = map(int, arg.split())
    div = [1]

    g = fractions.gcd(a, b)
    n = 2
    while n*n <= g:
        if g % n == 0:
            div.append(n)
            while g % n == 0:
                g = int(g/n)
        n += 1
    if g != 1:
        div.append(g)

    return str(len(div))


if __name__ == "__main__":
    print(solve(input()))

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


def solve(arg: str) -> str:
    a, b = map(int, arg.split())
    div = [1]
    for n in range(2, min(a, b) + 1):
        if a % n == 0 and b % n == 0:
            if(all([n % m != 0 for m in div if m != 1])):
                div.append(n)

    return str(len(div))


if __name__ == "__main__":
    print(solve(input()))


Fixed submission:
# coding: utf-8
import fractions


def solve(arg: str) -> str:
    a, b = map(int, arg.split())
    div = [1]

    g = fractions.gcd(a, b)
    n = 2
    while n*n <= g:
        if g % n == 0:
            div.append(n)
            while g % n == 0:
                g = int(g/n)
        n += 1
    if g != 1:
        div.append(g)

    return str(len(div))


if __name__ == "__main__":
    print(solve(input()))

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


def solve(arg: str) -> str:
    a, b = map(int, arg.split())
    div = [1]
    for n in range(2, min(a, b) + 1):
        if a % n == 0 and b % n == 0:
            if(all([n % m != 0 for m in div if m != 1])):
                div.append(n)

    return str(len(div))


if __name__ == "__main__":
    print(solve(input()))


Fixed submission:
# coding: utf-8
import fractions


def solve(arg: str) -> str:
    a, b = map(int, arg.split())
    div = [1]

    g = fractions.gcd(a, b)
    n = 2
    while n*n <= g:
        if g % n == 0:
            div.append(n)
            while g % n == 0:
                g = int(g/n)
        n += 1
    if g != 1:
        div.append(g)

    return str(len(div))


if __name__ == "__main__":
    print(solve(input()))