aaaa a abcd cb a abab
4
 0
 0

s, t = raw_input().split()
#t=raw_input()
x=0;
l_t = len(t)
l_s = len(s)
substr= []
ans =[]
for i in range(l_s):
	for j in range(i,l_s):
		substr.append(s[i:j + 1])
		

for y in range(len(substr)):
	if (t in substr[y]):
		if(substr[y] not in ans):
			ans.append(substr[y])
 			x=x+1
#for i in range(len(substr)):	
	


#print substr
#print ans.count(t)
#print ans
print x