aaaa a abcd cb a abab
4
 0
 0

s,t=raw_input().split()
le=len(s)
l=[]
for i in xrange(le):
	x=""
	for j in xrange(i,le):
		x+=s[j]
		if t in x:
			l.append(x)
l.sort()
le=len(l)
if le>1:
	c=1
else:
	c=0
for i in xrange(1,le):
	if l[i]!=l[i-1]:
		c+=1
print c