Buggy python submission (verdict: Time Limit Exceeded):
a,b = map(int,input().split())
import math 
import fractions
def is_prime(n):
	if n == 1: return False

	for k in range(3, int(math.sqrt(n)) + 1,2):
		if n % k == 0:
			return False

	return True

gc = fractions.gcd(a,b)
if gc == 1:
	print(1)
	exit()

list1 = [1]
list2 = [1]
if a%2 == 0 and b%2 == 0:
	list1.append(2)
	list2.append(2)
cout = 0 #1がfalse判定される

for i in range(3,gc+1,2):
	if a%i == 0:
		if is_prime(i):
			list1.append(i)
for i in range(3,gc+1,2):
	if b%i == 0:
		if is_prime(i):
			list2.append(i)

list3 = set(list1) & set(list2)

print(len(list3))

Fixed submission:
import fractions
a,b = map(int,input().split())
"""素因数分解"""
def factrize(n):
	b = 2
	fct = []
	while b*b <= n:
		while n % b == 0:
			n //= b
			#もし素因数を重複させたくないならここを加えてfct.append(b)を消す
			
			if not b in fct:
				fct.append(b)
			
			
		b = b+1
	if n > 1:
		fct.append(n)
	return fct #リストが帰る

gc = fractions.gcd(a,b)

ans = factrize(gc)
print(len(ans)+1)

Buggy python submission (verdict: Time Limit Exceeded):
a,b = map(int,input().split())
import math 
import fractions
def is_prime(n):
	if n == 1: return False

	for k in range(3, int(math.sqrt(n)) + 1,2):
		if n % k == 0:
			return False

	return True

gc = fractions.gcd(a,b)
if gc == 1:
	print(1)
	exit()

list1 = [1,2]

cout = 0 #1がfalse判定される
for i in range(3,gc+1,2):
	if is_prime(i):
		list1.append(i)
for i in range(len(list1)):
	if a % list1[i] == 0 and b % list1[i] == 0:
		cout += 1

print(cout)

Fixed submission:
import fractions
a,b = map(int,input().split())
"""素因数分解"""
def factrize(n):
	b = 2
	fct = []
	while b*b <= n:
		while n % b == 0:
			n //= b
			#もし素因数を重複させたくないならここを加えてfct.append(b)を消す
			
			if not b in fct:
				fct.append(b)
			
			
		b = b+1
	if n > 1:
		fct.append(n)
	return fct #リストが帰る

gc = fractions.gcd(a,b)

ans = factrize(gc)
print(len(ans)+1)

Buggy python submission (verdict: Time Limit Exceeded):
a,b = map(int,input().split())
import math 
import fractions
def is_prime(n):
	if n == 1: return False

	for k in range(2, int(math.sqrt(n)) + 1):
		if n % k == 0:
			return False

	return True

#ユークリッドの互除法
gc = fractions.gcd(a,b)
if gc == 1:
	print(1)
	exit()

list1 = [1]
cout = 0 #1がfalse判定される
for i in range(2,gc+1):
	if is_prime(i):
		list1.append(i)
for i in range(len(list1)):
	if a % list1[i] == 0 and b % list1[i] == 0:
		cout += 1

"""
for i in range(1,gc+1):
	if a % i == 0 and b % i == 0:
		if is_prime(i):
			cout+= 1
"""
print(cout)

Fixed submission:
import fractions
a,b = map(int,input().split())
"""素因数分解"""
def factrize(n):
	b = 2
	fct = []
	while b*b <= n:
		while n % b == 0:
			n //= b
			#もし素因数を重複させたくないならここを加えてfct.append(b)を消す
			
			if not b in fct:
				fct.append(b)
			
			
		b = b+1
	if n > 1:
		fct.append(n)
	return fct #リストが帰る

gc = fractions.gcd(a,b)

ans = factrize(gc)
print(len(ans)+1)

Buggy python submission (verdict: Time Limit Exceeded):
a,b = map(int,input().split())
import math 
import fractions
def is_prime(n):
	if n == 1: return False

	for k in range(2, int(math.sqrt(n)) + 1):
		if n % k == 0:
			return False

	return True

#ユークリッドの互除法
gc = fractions.gcd(a,b)
if gc == 1:
	print(1)
	exit()


cout = 1 #1がfalse判定される
for i in range(1,gc+1):
	if a % i == 0 and b % i == 0:
		if is_prime(i):
			cout+= 1
print(cout)

Fixed submission:
import fractions
a,b = map(int,input().split())
"""素因数分解"""
def factrize(n):
	b = 2
	fct = []
	while b*b <= n:
		while n % b == 0:
			n //= b
			#もし素因数を重複させたくないならここを加えてfct.append(b)を消す
			
			if not b in fct:
				fct.append(b)
			
			
		b = b+1
	if n > 1:
		fct.append(n)
	return fct #リストが帰る

gc = fractions.gcd(a,b)

ans = factrize(gc)
print(len(ans)+1)