aaaa a abcd cb a abab
4
 0
 0

m,t=map(str,raw_input().split(" "))
count=0
liso=[]
#print "sda",m[0:0]
if(t not in m):
	print count
else:
	for i in range(len(m)+1):
		for j in range(i,len(m)+1,1):
			#print m[i:j],i,j
			if(t in m[i:j]):
				count=count+1
				liso.append(m[i:j])
	print len(set(liso))