aaaa a abcd cb a abab
4
 0
 0

a,b = map(str,raw_input().split(' '))
n = len(a)
count = 0
dict = {}
for i in range(1,n+1):
	for j in range(n-i+1):
		s = a[j:j+i]
		if s not in dict:
			dict[s] = 1
			if (b) in s:
				count += 1;
print count