aaaa a abcd cb a abab
4
 0
 0

s,t = raw_input().split()

sl = len(s)
tl = len(t)

m = []

c = 0

for j in range(0,sl+1):
    for k in range(j,sl+1):
        #print(k,j,sl)
        #print(s[j:k])
        if t in s[j:k]:
            m.append(s[j:k])
            #print(s[j:k])
            c+=1

#print(c)
print len(list(set(m)))