#include <bits/stdc++.h>
using namespace std;
#define ll long long

map<pair<string,string>,ll>M;
int main(){
  int n;cin>>n;
  string s;cin>>s;
  for(int i=0;i<(1<<n);++i){
    string red="",blue="";
    for(int j=0;j<n;++j){
      if(i&(1<<j))red+=s[j];
      else blue+=s[j];
    }
    ++M[make_pair(red,blue)];
  }
  ll ans=0;
  for(int i=0;i<(1<<n);++i){
    string red="",blue="";
    for(int j=0;j<n;++j){
      if(i&(1<<j))red+=s[j+n];
      else blue+=s[j+n];
    }
    reverse(red.begin(),red.end());
    reverse(blue.begin(),blue.end());
    ans+=M[make_pair(blue,red)];
  }
  cout<<ans<<endl;
}