aaaa a abcd cb a abab
4
 0
 0

s,t=raw_input().split(' ')
count=0
sub=[]
for i in xrange(0,len(s)):
	for j in xrange(i,len(s)+1):
		
		if(s[i:j] not in sub):
			sub.append(s[i:j])
for i in sub:
	if(t in i):
		count+=1
print count