There is a string of length , which consists only of the letters A, T, C, G.
Two strings of the same length are said to be complementary if at each position the characters form one of the following pairs:
\texttt{A} \leftrightarrow \texttt{T},\quad \texttt{C} \leftrightarrow \texttt{G}.
In other words, A matches only with T, T only with A, C with G, and vice versa.
For example, the strings ATCG and TAGC are complementary because:
\texttt{A-T},\ \texttt{T-A},\ \texttt{C-G},\ \texttt{G-C}.
A string is called permutationally complementary if there is a permutation of its letters that is complementary to the string itself.
Now the task. Count the number of pairs (i, j): 1 \le i \le j \le n, such that the substring s[i:j] is permutationally complementary.
A substring of string denoted as s[i:j] is a string consisting of characters s_i, s_{i+1}, \ldots, s_j.
The first line contains a single integer (1 \le n \le 2 \cdot 10^5) — the length of the string.
The second line contains the string , which consists only of the letters A, T, C, G.
Output the number of such pairs .
Example 1
Example 2