aaaa a abcd cb a abab
4
 0
 0

'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
#print 'Hello World!'
s,t=map(str,raw_input().split())
c=[]
for i in range(len(s)):
	for j in range(i,len(s)):
		x=s[i:j+1]
		#print x
		if t in x:
			c.append(x)
print len(set(c))