aaaa a abcd cb a abab
4
 0
 0

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)]
x,y=raw_input().split()
ans=0
al=set(get_all_substrings(x))
for i in al:
    if y in i:
        ans+=1   
print ans