Buggy python submission (verdict: Time Limit Exceeded):
def main():
  import fractions
  import math

  a,b = map(int,input().split())
  g = fractions.gcd(a,b)
  
  d = [1]
  num = 2

  while num <= g:
    #print("num",num)
    if g%num == 0:
      d.append(num)
    while g%num == 0 and g>1:
      g = g//num
      #print(g)
    num += 1
  
  print(len(d))

if __name__ == "__main__":
  main()



Fixed submission:
def main():
  import fractions
  import math

  a,b = map(int,input().split())
  g = fractions.gcd(a,b)
  
  d = [1]
  num = 2

  while num**2 <= g:
    #print("num",num)
    if g%num == 0:
      d.append(num)
    while g%num == 0 and g>1:
      g = g//num
      #print(g)
    num += 1
  
  print(len(d) + (g > 1))

if __name__ == "__main__":
  main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
  import fractions
  import math

  a,b = map(int,input().split())
  
  d = [1]
  num = 2

  while num <= min(a,b):
    #print("num",num)
    if a%num == 0 and b%num == 0:
      d.append(num)
    while a%num == 0 and a>1:
      a = a//num
      #print(a)
    while b%num == 0 and b>1:
      b = b//num
      #print(b)
    num += 1
  
  print(len(d))

if __name__ == "__main__":
  main()



Fixed submission:
def main():
  import fractions
  import math

  a,b = map(int,input().split())
  g = fractions.gcd(a,b)
  
  d = [1]
  num = 2

  while num**2 <= g:
    #print("num",num)
    if g%num == 0:
      d.append(num)
    while g%num == 0 and g>1:
      g = g//num
      #print(g)
    num += 1
  
  print(len(d) + (g > 1))

if __name__ == "__main__":
  main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
  import fractions
  import math

  a,b = map(int,input().split())

  if a>b:
    a,b = b,a
  
  d = [1]
  num = 2

  while num <= min(a,b):
    if a%num == 0 and b%num == 0:
      d.append(num)
      while a%num == 0 and a>1:
        a = a//num
      while b%num == 0 and b>1:
        b = b//num
    num+=1
  
  print(len(d))

if __name__ == "__main__":
  main()


Fixed submission:
def main():
  import fractions
  import math

  a,b = map(int,input().split())
  g = fractions.gcd(a,b)
  
  d = [1]
  num = 2

  while num**2 <= g:
    #print("num",num)
    if g%num == 0:
      d.append(num)
    while g%num == 0 and g>1:
      g = g//num
      #print(g)
    num += 1
  
  print(len(d) + (g > 1))

if __name__ == "__main__":
  main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
  import fractions
  import math

  a,b = map(int,input().split())

  if a>b:
    a,b = b,a
  
  d = [1]
  num = 2

  while num <= min(a,b):
    if a%num == 0 and b%num == 0:
      d.append(num)
      while a%num == 0 and a>0:
        a = a//num
      while b%num == 0 and b>0:
        b = b//num
    num+=1
  
  print(len(d))

if __name__ == "__main__":
  main()


Fixed submission:
def main():
  import fractions
  import math

  a,b = map(int,input().split())
  g = fractions.gcd(a,b)
  
  d = [1]
  num = 2

  while num**2 <= g:
    #print("num",num)
    if g%num == 0:
      d.append(num)
    while g%num == 0 and g>1:
      g = g//num
      #print(g)
    num += 1
  
  print(len(d) + (g > 1))

if __name__ == "__main__":
  main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
  import fractions
  import math

  a,b = map(int,input().split())

  if a>b:
    a,b = b,a
  
  d = [1]
  num = 2

  while num <= min(a,b):
    if a%num == 0 and b%num == 0:
      d.append(num)
      while a%num == 0:
        a = a//num
      while b%num == 0:
        b = b//num
    num+=1
  
  print(len(d))

if __name__ == "__main__":
  main()

Fixed submission:
def main():
  import fractions
  import math

  a,b = map(int,input().split())
  g = fractions.gcd(a,b)
  
  d = [1]
  num = 2

  while num**2 <= g:
    #print("num",num)
    if g%num == 0:
      d.append(num)
    while g%num == 0 and g>1:
      g = g//num
      #print(g)
    num += 1
  
  print(len(d) + (g > 1))

if __name__ == "__main__":
  main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
  import fractions
  import math

  a,b = map(int,input().split())

  if a>b:
    a,b = b,a
  
  d = [1]
  num = 2

  while num <= min(a,b):
    if a%num == 0 and b%num == 0:
      d.append(num)
    while a%num == 0:
      a = a//num
    while b%num == 0:
      b = b//num
    num+=1
  
  print(len(d))

if __name__ == "__main__":
  main()



Fixed submission:
def main():
  import fractions
  import math

  a,b = map(int,input().split())
  g = fractions.gcd(a,b)
  
  d = [1]
  num = 2

  while num**2 <= g:
    #print("num",num)
    if g%num == 0:
      d.append(num)
    while g%num == 0 and g>1:
      g = g//num
      #print(g)
    num += 1
  
  print(len(d) + (g > 1))

if __name__ == "__main__":
  main()

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

a,b = map(int,input().split())

if a>b:
  a,b = b,a
  
n=fractions.gcd(a,b)

d = [1]
num = 2

while n>1:
  if n%num == 0:
    d.append(num)
  while n%num == 0:
    n = n//num
  num+=1
  
print(len(d))

Fixed submission:
def main():
  import fractions
  import math

  a,b = map(int,input().split())
  g = fractions.gcd(a,b)
  
  d = [1]
  num = 2

  while num**2 <= g:
    #print("num",num)
    if g%num == 0:
      d.append(num)
    while g%num == 0 and g>1:
      g = g//num
      #print(g)
    num += 1
  
  print(len(d) + (g > 1))

if __name__ == "__main__":
  main()

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

a,b = map(int,input().split())

if a>b:
  a,b = b,a
  
n=fractions.gcd(a,b)

t = [True]*(2*n)
d = [1]

for i in range(2, n):
  if t[i] is False:
    continue
  if n % i == 0:
    d.append(i)
    for j in range(i+1, n):
      if j%i==0:
        t[j] = False
print(len(d))

Fixed submission:
def main():
  import fractions
  import math

  a,b = map(int,input().split())
  g = fractions.gcd(a,b)
  
  d = [1]
  num = 2

  while num**2 <= g:
    #print("num",num)
    if g%num == 0:
      d.append(num)
    while g%num == 0 and g>1:
      g = g//num
      #print(g)
    num += 1
  
  print(len(d) + (g > 1))

if __name__ == "__main__":
  main()