aaaa a abcd cb a abab
4
 0
 0

inp = raw_input().split()
s = inp[0]
t = inp[1]
ss = []
cnt = 0
for i in xrange(1,len(s)+1):
    for j in xrange(0,len(s)):
        v = s[j:j+i]
        if(t in v):
            ss+=[v]
ss = set(ss)
print len(ss)