aaaa a abcd cb a abab
4
 0
 0

a, b = raw_input().split()
cnt = 0
lst = []
for i in range(len(a)):
    for j in range(i,len(a)):
        tmp = a[i:j+1]
        if b in tmp:
            if tmp not in lst:
                cnt+=1
                lst.append(tmp)
     
print cnt