n, k = map(int, input().split()) d = n - k p = 0 for i in range(d): if d / (i + 1) == float(d // (i + 1)): if i == 0 and k != 0: pass else: p += 1 print(p)