In the not-so-distant future, LaTeX, the venerable typesetting system that had been a staple of academia and publishing for decades, found itself evolving into a couple of derivatives — "Dark LaTeX" and "Light LaTeX". These derivatives primarily optimized the appearance from different angles to adapt to screenless display technology.
For compatibility trial, the LaTeX lab has obtained two non-empty strings containing only lowercase English letters through analysis — the Dark LaTeX string $$$S = s_1 s_2 \cdots s_{|S|}$$$ and the Light LaTeX string $$$T = t_1 t_2 \cdots t_{|T|}$$$, where $$$|S|$$$ denotes the length of $$$S$$$, and $$$|T|$$$ denotes the length of $$$T$$$. An integer quadruple $$$(p,q,u,v)$$$ is considered transferrable if and only if $$$1 \le p \le q \le |S|$$$, $$$1 \le u \le v \le |T|$$$, and $$$s_p s_{p+1} \cdots s_q t_u t_{u+1} \cdots t_v$$$ is a square string.
Your task is to help the lab find out the number of transferrable quadruples.
Recall that a square string is a string of even length in which the first half is identical to the second half. For example, "aaaa" and "abcabc" are square strings, while "aaa" and "abcabd" are not.
The input consists of two lines, where the first line contains the Dark LaTeX string $$$S$$$, and the second line contains the Light LaTeX string $$$T$$$.
It is guaranteed that both $$$S$$$ and $$$T$$$ consist only of lowercase English letters and their lengths do not exceed $$$5\,000$$$.
Output an integer in one line, indicating the number of transferrable quadruples.
abab ab
8
abab abaaab
29
In the first sample case, the transferrable quadruples are $$$(1,1,1,1)$$$, $$$(1,2,1,2)$$$, $$$(1,3,2,2)$$$, $$$(2,2,2,2)$$$, $$$(2,4,1,1)$$$, $$$(3,3,1,1)$$$, $$$(3,4,1,2)$$$, $$$(4,4,2,2)$$$.
| Name |
|---|


