Buggy python submission (verdict: Time Limit Exceeded):
import fractions
from math import sqrt

A, B = map(int, input().split())

G = fractions.gcd(A, B)
N = int(sqrt(G))+1
g = G
ans = 1

for i in range(G):
    if (g < i):
        break
    if(g % (i+2) == 0):
        ans += 1
        while(g % (i+2) == 0):
            g /= i+2

print(ans)


Fixed submission:
import fractions
from math import sqrt

A, B = map(int, input().split())

G = fractions.gcd(A, B)
N = int(sqrt(max(A,B)))+1
g = G
ans = 1

for i in range(2, N+3):
    if(g % i == 0):
        ans += 1
        while(g % i == 0):
            g = g/i
            
if g != 1:
    ans += 1

print(ans)

Buggy python submission (verdict: Runtime Error):
import fractions
from math import sqrt

A, B = map(int, input().split())

G = fractions.gcd(A, B)
N = sqrt(G)+1
g = G
ans = 1


for i in range(2, N+1):
    if (g < i):
        break
    if(g % (i) == 0):
        ans += 1
        while(g % (i) == 0):
            g /= i

print(ans)


Fixed submission:
import fractions
from math import sqrt

A, B = map(int, input().split())

G = fractions.gcd(A, B)
N = int(sqrt(max(A,B)))+1
g = G
ans = 1

for i in range(2, N+3):
    if(g % i == 0):
        ans += 1
        while(g % i == 0):
            g = g/i
            
if g != 1:
    ans += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):

import fractions

A, B = map(int, input().split())

G = fractions.gcd(A, B)
g = G
ans = 1


for i in range(G-1):
    if (g < i):
        break
    if(g % (i+2) == 0):
        ans += 1
        j = 1
        while(g % (i+2) == 0):
            g /= i+2
            j += 1

print(ans)


Fixed submission:
import fractions
from math import sqrt

A, B = map(int, input().split())

G = fractions.gcd(A, B)
N = int(sqrt(max(A,B)))+1
g = G
ans = 1

for i in range(2, N+3):
    if(g % i == 0):
        ans += 1
        while(g % i == 0):
            g = g/i
            
if g != 1:
    ans += 1

print(ans)

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

A, B = map(int, input().split())

G = math.gcd(A, B)
ans = 1

for i in range(G-1):
    if (G < i):
        break
    if(G % (i+2) == 0):
        ans += 1
        j = 1
        while(G % ((i+2)**j) == 0):
            G /= i+2
            j += 1

print(ans)



Fixed submission:
import fractions
from math import sqrt

A, B = map(int, input().split())

G = fractions.gcd(A, B)
N = int(sqrt(max(A,B)))+1
g = G
ans = 1

for i in range(2, N+3):
    if(g % i == 0):
        ans += 1
        while(g % i == 0):
            g = g/i
            
if g != 1:
    ans += 1

print(ans)

Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())

import math
# import time

G = math.gcd(A, B)
ans = 1
# print("G:", G)



for i in range(G-1):
    if (G < i):
        break
    # print("G % (i+1) == 0:", G % (i+1) == 0)
    if(G % (i+2) == 0):
        ans += 1
        j = 1
        while(G % ((i+2)**j) == 0):
            G /= i+2
            j += 1
            # print("i:", i + 2, "j:", j)
            # time.sleep(1)

print(ans)



Fixed submission:
import fractions
from math import sqrt

A, B = map(int, input().split())

G = fractions.gcd(A, B)
N = int(sqrt(max(A,B)))+1
g = G
ans = 1

for i in range(2, N+3):
    if(g % i == 0):
        ans += 1
        while(g % i == 0):
            g = g/i
            
if g != 1:
    ans += 1

print(ans)