#include<stdio.h>
int main(void){
  char *s="python3 -c\""
"import itertools as I\n"
"from collections import Counter as C\n"
"n=int(input());s=input();l=s[:n];r=s[n:][::-1];a=C();b=C()\n"
"for i in I.product([0,1],repeat=n):\n"
" t=u=v=w=''\n"
" for j in range(n):\n"
"  if i[j]:t+=l[j];u+=r[j]\n"
"  else:v+=l[j];w+=r[j]\n"
" a[t,v]+=1\n"
" b[u,w]+=1\n"
"print(sum(a[i]*b[i]for i in a.keys()))\n"
"\"";
  system(s);
  return 0;
}            