Problem: You are given a string S of length 2N consisting of lowercase English letters.

There are 2^{2N} ways to color each character in S red or blue. Among these ways, how many satisfy the following condition?

* The string obtained by reading the characters painted red from left to right is equal to the string obtained by reading the characters painted blue from right to left.

Constraints

* 1 \leq N \leq 18
* The length of S is 2N.
* S consists of lowercase English letters.

Input

Input is given from Standard Input in the following format:


N
S


Output

Print the number of ways to paint the string that satisfy the condition.

Examples

Input

4
cabaacba


Output

4


Input

11
mippiisssisssiipsspiim


Output

504


Input

4
abcdefgh


Output

0


Input

18
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa


Output

9075135300

Solution (in PYTHON3):

Solution:
def f(i, k):
    if i == n and k == 0:
        global d
        hr1, hb1 = 0, 0
        hr2, hb2 = 0, 0
        cntr, cntb = 0, 0
        for j in range(n):
            if c[j]:
                hr1 += x[j] * pow(b1, cntr, mod)
                hr2 += x[j] * pow(b2, cntr, mod)
                hr1 %= mod
                hr2 %= mod
                cntr += 1
            else:
                hb1 += x[j] * pow(b1, cntb, mod)
                hb2 += x[j] * pow(b2, cntb, mod)
                hb1 %= mod
                hb2 %= mod
                cntb += 1
        if min(cntr, cntb) == 0:
            return
        if (hr1, hr2, hb1, hb2) in d:
            d[(hr1, hr2, hb1, hb2)] += 1
        else:
            d[(hr1, hr2, hb1, hb2)] = 1
        return
    elif i == n and k == 1:
        hr1, hb1 = 0, 0
        hr2, hb2 = 0, 0
        cntr, cntb = 0, 0
        for j in range(n):
            if c[j]:
                hr1 += y[j] * powb1[cntr]
                hr2 += y[j] * powb2[cntr]
                hr1 %= mod
                hr2 %= mod
                cntr += 1
            else:
                hb1 += y[j] * powb1[cntb]
                hb2 += y[j] * powb2[cntb]
                hb1 %= mod
                hb2 %= mod
                cntb += 1
        if min(cntr, cntb) == 0:
            return
        if (hr1, hr2, hb1, hb2) in d:
            global ans
            ans += d[(hr1, hr2, hb1, hb2)]
        return
    c[i] = 1
    f(i + 1, k)
    c[i] = 0
    f(i + 1, k)


n = int(input())
s = list(input())
mod = pow(2, 31) - 1
b1, b2 = 27, 31
powb1 = [pow(27, i, mod) for i in range(n)]
powb2 = [pow(31, i, mod) for i in range(n)]
d = {}
x, y = [], []
for i in range(n):
    x.append(ord(s[i]) - 96)
    y.append(ord(s[-(i + 1)]) - 96)
ans = 0 if not x == y else 2
c = [0] * n
f(0, 0)
c = [0] * n
f(0, 1)
print(ans)