#include<iostream>
#include<map>
#include<algorithm>
using namespace std;
map<pair<string,string>,long>M;
int n;string s;
int main()
{
  cin>>n>>s;
  for(int i=0;i<1<<n;i++)
  {
    string a="",b="";
    for(int j=0;j<n;j++)
    {
      if(i&1<<j)a+=s[j];
      else b+=s[j];
    }
    M[make_pair(a,b)]++;
  }
  long ans=0;
  for(int i=0;i<1<<n;i++)
  {
    string a="",b="";
    for(int j=0;j<n;j++)
    {
      if(i&1<<j)a+=s[n+j];
      else b+=s[n+j];
    }
    reverse(a.begin(),a.end());
    reverse(b.begin(),b.end());
    ans+=M[make_pair(b,a)];
  }
  cout<<ans<<endl;
}
