Bob has two strings a and b, he wants to calculate the similarity of them. The similarity is defined by the sum of the number of times in string a for each substring in string b.
The first line is the string a.
The second line is the string b.
All strings consist of only lowercase English letters.
The length of string a and the length of string b will not exceed 500000.
Output the similarity of two strings.
For the substring “b”,it appears 2 times in string a.
For the substring “bb”,it appears 1 time in string a.
For the substring “bba”,it appears 0 time in string a.
For the substring “b”,it appears 2 times in string a.
For the substring “ba”,it appears 0 time in string a.
For the substring “a”,it appears 1 time in string a.
So, the similarity is 2+1+0+2+0+1=6.