from collections import defaultdict

n = int(eval(input()))

s = eval(input())



a = s[:n]

b = s[n:][::-1]

d = defaultdict(int)

e = defaultdict(int)



def cnt(c, d):

    for bit in range(1 << n):

        x = []

        y = []

        for i in range(n):

            if bit >> i & 1:

                x.append(c[i])

            else:

                y.append(c[i])

        d[(str(x), str(y))] += 1





cnt(a, d)

cnt(b, e)



ans = 0

for k, v in list(d.items()):

    ans += e[k] * v

print(ans)

from collections import defaultdict

n = int(eval(input()))

s = eval(input())



a = s[:n]

b = s[n:][::-1]

d = defaultdict(int)

e = defaultdict(int)



for bit in range(1 << n):

    x = ""

    y = ""

    z = ""

    w = ""

    for i in range(n):

        if bit >> i & 1:

            x += a[i]

            z += b[i]

        else:

            y += a[i]

            w += b[i]

    d[x+'ω'+y] += 1

    e[z+'ω'+w] += 1



print((sum([e[k] * v for k, v in list(d.items())])))

from collections import defaultdict

n = int(eval(input()))
s = eval(input())
a = s[:n]
b = s[n:][::-1]
d = defaultdict(int)
e = defaultdict(int)


def cnt(c, d):
    for bit in range(1 << n):
        x = []
        y = []
        for i in range(n):
            if bit >> i & 1:
                x.append(c[i])
            else:
                y.append(c[i])
        d[(str(x), str(y))] += 1


cnt(a, d)
cnt(b, e)
ans = 0
for k, v in list(d.items()):
    ans += e[k] * v
print(ans)

from collections import defaultdict

n = int(eval(input()))
s = eval(input())
a = s[:n]
b = s[n:][::-1]
d = defaultdict(int)
e = defaultdict(int)
for bit in range(1 << n):
    x = ""
    y = ""
    z = ""
    w = ""
    for i in range(n):
        if bit >> i & 1:
            x += a[i]
            z += b[i]
        else:
            y += a[i]
            w += b[i]
    d[x + "ω" + y] += 1
    e[z + "ω" + w] += 1
print((sum([e[k] * v for k, v in list(d.items())])))

- - -def cnt(c, d): -    for bit in range(1 << n): -        x = [] -        y = [] -        for i in range(n): -            if bit >> i & 1: -                x.append(c[i]) -            else: -                y.append(c[i]) -        d[(str(x), str(y))] += 1 - - -cnt(a, d) -cnt(b, e) -ans = 0 -for k, v in list(d.items()): -    ans += e[k] * v -print(ans) +for bit in range(1 << n): +    x = "" +    y = "" +    z = "" +    w = "" +    for i in range(n): +        if bit >> i & 1: +            x += a[i] +            z += b[i] +        else: +            y += a[i] +            w += b[i] +    d[x + "ω" + y] += 1 +    e[z + "ω" + w] += 1 +print((sum([e[k] * v for k, v in list(d.items())])))