aaaa a abcd cb a abab
4
 0
 0

s=raw_input()
lst=s.split()
lst1=[]
c=0
for i in range(len(lst[0])):
    for j in range(len(lst[0])):
        lst1.append(lst[0][i:j+1])
st=set(lst1)
lst2=list(st)
for i in range(len(lst2)):
    if lst[1] in lst2[i]:
        c=c+1
print c