aaaa a abcd cb a abab
4
 0
 0

#!/usr/bin/python
a = raw_input()
a = a.split(' ')
s = a[0]
t = a[1]
l = len(s)
count=0
final = []
for i in xrange(0,l):
	for j in xrange(i,l):
		temp = s[i:j+1]
		if temp not in final:
			final.append(temp)
			if temp.count(t):
				count+=1;
print count