aaaa a abcd cb a abab
4
 0
 0

def get_substrings(string):
	l = len(string)
	subs = set([])
	for i in xrange(l):
		for j in xrange(i, l):
			subs.add(string[i:j+1])
	return subs

s, t = raw_input().split()

count = 0
for sub in get_substrings(s):
	if t in sub:
		count += 1

print count