#include<iostream>
#include<string>
#include<map>
#define ll long long
using namespace std;
map<pair<string, string>, ll> mp;
string a;
int main()
{
	ll n;
	scanf("%lld", &n);
	cin >> a;
	for (ll i = 0; i < (1 << n); i++)
	{
		string q, w;
		for (ll y = 0; y < n; y++)
		{
			if (i&((ll)1<<y))q += a[y];
			else w += a[y];
		}
		mp[{q, w}]++;
	}
	ll sum = 0;
	for (ll i = 0; i < (1 << n); i++)
	{
		string q, w;
		for (ll y = n - 1; y >= 0; y--)
		{
			if (i & ((ll)1<<y))w += a[y + n];
			else q += a[y + n];
		}
		sum += mp[{q, w}];
	}
	printf("%lld", sum);
}