aaaa a abcd cb a abab
4
 0
 0

def solve(s,t):
    st = set()
    n = len(s)
    for i in range(n):
        for j in range(i+1,n+1):
            m = s[i:j]
            if t in m and m not in st:
                st.add(m)
    print(len(st))

s,t = raw_input().split()

solve(s,t)