ABinput = input() ABsplit = ABinput.split() A = int(ABsplit[0]) B = int(ABsplit[1]) Adivide = [] if A % B != 0: pass else: for i in range(1,A+1,1): if i*i > A: break else: if A%i == 0: Adivide.append(i) if A//i != i: Adivide.append(A//i) awnser = 0 if len(Adivide) != 0: for i in range(B,A+1,B): if i in Adivide: awnser += 1 print(awnser)