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
'''
def get_all_substrings(string):
	length = len(string)
	alist = []
	for i in xrange(length):
		for j in xrange(i,length):
			if string[i:j + 1] not in alist:
				alist.append(string[i:j + 1]) 
	return alist
d=raw_input()
dd=d.split()

a=get_all_substrings(dd[0])


s=dd[1]
count=0
for i in a:
	if s in i:
		count+=1
print count