Consider an arbitrary string . We will refer to this string as a palindrome generator. The set of palindromes generated by this string is defined as follows:
Let the length of the string be . For each from to , the strings g[1..i]g[1..i]^r and g[1..i]g[1..i-1]^r are included in , where \alpha^r denotes the reverse of .
For example, if g = \text{olymp}, then P(g) = \{\text{oo}, \text{o}, \text{ollo}, \text{olo}, \text{olyylo}, \text{olylo}, \text{olymmylo}, \text{olymylo}, \text{olymppmylo}, \text{olympmylo}\}.

Given a palindrome generator and a string , determine how many times strings from appear as substrings in . Specifically, find the number of pairs such that s[i..j] \in P(g).
The first line of the input file contains the string . The second line contains the string . Both strings are non-empty and have a length of no more than characters.
Output the number of pairs such that s[i..j] \in P(g).
Example 1