aaaa a abcd cb a abab
4
 0
 0

S,T = raw_input().split()

def get_all_substrings(input_string):
  length = len(input_string)
  return [input_string[i:j+1] for i in xrange(length) for j in xrange(i,length)]
  
Z = set(get_all_substrings(S))
h = 0
for x in Z:
	if T in x:
		h = h +1
		
		
print(h)