aaaa a abcd cb a abab
4
 0
 0

S, T = map(str, raw_input().split())
seen={}
ans=0
for i in xrange(len(S)):
	s=""
	for j in xrange(i,len(S)):
		s+=S[j]
		if s not in seen and T in s:
			ans+=1
			seen[s]=1
print ans