#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define LL long long
#define st first
#define nd second
#define endl '\n'
using namespace std;

LL ans;

int main() {

	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n;
	string s,a,b;
	cin>>n>>s;
	map<pair<string,string>,int > m;
	for(int i=0;i<(1<<n);++i) {
		a=b="";
		for(int j=0;j<n;++j)
			if(i&(1<<j)) {
				a+=s[j];
			}
			else b+=s[j];
		m[mp(a,b)]++;
	}
	for(int i=0;i<(1<<n);++i) {
		a=b="";
		for(int j=n-1;j>=0;--j)
			if(i&(1<<j)) {
				b+=s[j+n];
			}
			else a+=s[j+n];
		ans+=m[mp(a,b)];
	}
	cout<<ans<<endl;

}