aaaa a abcd cb a abab
4
 0
 0

s,t=raw_input().strip().split()
n=len(s)
l=set()
for i in xrange(n).__reversed__():
    for j in xrange(n-i):
        l.add(s[j:j+i+1])
c=0
for x in l:
    if t in x:
        c+=1
print c