aaaa a abcd cb a abab
4
 0
 0

s,x=map(str,raw_input().split())
l=len(s)
n=0
d=[]
for i in range(l):
    for j in range(i+1,l+1):
        t=s[i:j]
        if x in t:
            if t not in d:
                n=n+1
                d.append(t)
print n