aaaa a abcd cb a abab
4
 0
 0

a=list(map(str,raw_input().split()))
k=len(a)
s=a[0]
hmm=list(set([s[i:i+j] for j in range(1,len(s)+1) for i in range(len(s)-j+1)]))
p=0
count=0
while p<len(hmm):
	tr= hmm[p].find(a[1])
	if tr != -1:
		count=count+1
	p=p+1
print count