Buggy python submission (verdict: Runtime Error):
import fractions
import math
a,b = map(int, input().split())
g = fractions.gcd(a,b)
ans = 1

for i in range(2, math.sqrt(g)+1):
  if g%i == 0:
    ans += 1
    while True:
      g //= i
      if g%i != 0:
        break
print(ans)

Fixed submission:
import fractions
import math
a,b = map(int, input().split())
g = fractions.gcd(a,b)
ans = 1

for i in range(2, int(math.sqrt(g))+1):
  if g%i == 0:
    ans += 1
    while True:
      g //= i
      if g%i != 0:
        break
if (g != 1):
  ans += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import fractions
import math
a,b = map(int, input().split())
g = fractions.gcd(a,b)
ans = 1

for i in range(2, g):
  if g//i == 1:
    ans += 1
    break
  elif g%i == 0:
    ans += 1
    while True:
      g //= i
      if g%i != 0:
        break
print(ans)

Fixed submission:
import fractions
import math
a,b = map(int, input().split())
g = fractions.gcd(a,b)
ans = 1

for i in range(2, int(math.sqrt(g))+1):
  if g%i == 0:
    ans += 1
    while True:
      g //= i
      if g%i != 0:
        break
if (g != 1):
  ans += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
import fractions
a,b = map(int, input().split())
g = fractions.gcd(a,b)
l = [0]*(g-1)

for i in range(2, g+1):
  if g%i == 0 and min(a,b)%i == 0:
    for j in range(2, i):
      if i%j == 0:
        break
    else:
      l[i] = 1

print(l.count(1)+1)

Fixed submission:
import fractions
import math
a,b = map(int, input().split())
g = fractions.gcd(a,b)
ans = 1

for i in range(2, int(math.sqrt(g))+1):
  if g%i == 0:
    ans += 1
    while True:
      g //= i
      if g%i != 0:
        break
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)
l = []

for i in range(2, g+1):
  if g%i == 0 and min(a,b)%i == 0:
    for j in range(2, i):
      if i%j == 0:
        break
    else:
      l.append(i)

print(len(l)+1)

Fixed submission:
import fractions
import math
a,b = map(int, input().split())
g = fractions.gcd(a,b)
ans = 1

for i in range(2, int(math.sqrt(g))+1):
  if g%i == 0:
    ans += 1
    while True:
      g //= i
      if g%i != 0:
        break
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)
ans = 1
if g == 2:
  ans += 1
elif g > 2 and g%2 == 0:
  ans += 1
  while True:
    g //= 2
    if g%2 != 0:
      break
      
if g == 3:
  ans += 1
elif g > 3 and g%3 == 0:
  ans += 1
  while True:
    g //= 3
    if g%3 != 0:
      break

      
if g == 5:
  ans += 1
elif g > 5 and g%5 == 0:
  ans += 1
  while True:
    g //= 5
    if g%5 != 0:
      break
      
      
if g == 7:
  ans += 1
elif g > 7 and g%7 == 0:
  ans += 1
  while True:
    g //= 7
    if g%7 != 0:
      break

      
if g == 11:
  ans += 1
elif g > 11 and g%11 == 0:
  ans += 1
  while True:
    g //= 11
    if g%11 != 0:
      break

if g == 13:
  ans += 1
elif g > 13 and g%13 == 0:
  ans += 1
  while True:
    g //= 13
    if g%13 != 0:
      break

if g >= 17:
  for i in range(3, g+1):
    if g%i == 0:
      for j in range(2, i):
        if i%j == 0:
          break
      else:
        ans += 1
  print(ans)
else:
  print(ans)


Fixed submission:
import fractions
import math
a,b = map(int, input().split())
g = fractions.gcd(a,b)
ans = 1

for i in range(2, int(math.sqrt(g))+1):
  if g%i == 0:
    ans += 1
    while True:
      g //= i
      if g%i != 0:
        break
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)
ans = 1
if g == 2:
  ans += 1
elif g > 2 and g%2 == 0:
  ans += 1
  while True:
    g //= 2
    if g%2 != 0:
      break
      
if g >= 3:
  for i in range(3, g+1):
    if g%i == 0:
      for j in range(2, i):
        if i%j == 0:
          break
      else:
        ans += 1
  print(ans)
else:
  print(ans)


Fixed submission:
import fractions
import math
a,b = map(int, input().split())
g = fractions.gcd(a,b)
ans = 1

for i in range(2, int(math.sqrt(g))+1):
  if g%i == 0:
    ans += 1
    while True:
      g //= i
      if g%i != 0:
        break
if (g != 1):
  ans += 1
print(ans)