@staticmethod
def b():
    (s, k) = sys.stdin.read().split()
    k = int(k)
    res = set()
    for i in range(((len(s) - k) + 1)):
        res.add(s[i:(i + k)])
    print(len(res))
@staticmethod
def b():
    (s, k) = sys.stdin.read().split()
    k = int(k)
    res = set()
    for i in range(((len(s) - k) + 1)):
        res.add(s[i:(i + k)])
    print(len(res))