aaaa a abcd cb a abab
4
 0
 0

s , t = raw_input().split()
ans = 0
mark = {}
for i in range(len(s)) :
	for j in range(i,len(s)) :
		if t in s[i:j+1] and s[i:j+1] not in mark.keys():
			ans += 1
			mark[s[i:j+1]] = 1
print ans