#include <bits/stdc++.h>
#define int long long
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;

typedef pair<string,string>P;

int n,ans;
string s;
map<pair<string,string> ,int>M;


signed main(){
	cin>>n>>s;
	string t=s.substr(n);
	r(i,(1<<n)){
		int x=__builtin_popcount(i);
		string y="",z="";
		r(j,n){
			if((1<<j)&i)y+=t[j];
			else z+=t[j];
		}
		reverse(y.begin(),y.end());
		reverse(z.begin(),z.end());
		M[P(y,z)]++;
	}
	t=s.substr(0,n);
	r(i,(1<<n)){
		int x=__builtin_popcount(i);
		int z=n-x;
		string y="",Z="";
		r(j,n){
			if((1<<j)&i)y+=t[j];
			else Z+=t[j];
		}
		if(y>Z)swap(y,Z);
		ans+=M[P(y,Z)];
		ans+=M[P(Z,y)];

	}
	cout<<ans/2<<endl;
}