aaaa a abcd cb a abab
4
 0
 0

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