#include <bits/stdc++.h>
#include <array>
using namespace std;
using ULL = unsigned long long;
using UL = unsigned;
using LL = long long;
#define rep(i, n) for(UL i = 0; i < (n); i++)

struct Problem {

	void Solve() {
		UL N; cin >> N;
		string S; cin >> S;
		string rS = S; reverse(rS.begin(), rS.end());
		ULL ans = 0;
		rep(i, (1 << N)) {
			string R, B;
			rep(j, N) { if (i & (1 << j)) R.push_back(S[j]); else B.push_back(S[j]); }
			R.push_back(' '); B.push_back(' ');
			UL dp[19][19] = {};
			dp[0][0] = 1;
			rep(b, B.size()) {
				rep(r, R.size()) {
					if (B[b] == rS[r + b]) dp[r][b + 1] += dp[r][b];
					if (R[r] == rS[r + b]) dp[r + 1][b] += dp[r][b];
				}
			}
			ans += dp[R.size() - 1][B.size() - 1];
		}
		cout << ans << endl;
	}


	Problem();
};
int main() {
	unique_ptr<Problem> p(new Problem());
	p->Solve();
	return 0;
}
Problem::Problem() {
	cout << fixed << setprecision(10);
}
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef set<int> si;
typedef pair<int,int> pii;
#define rep(i,a,b) for(int i=(a); i<(b); ++i)
#define per(i,a,b) for(int i=(b)-1; i>=(a); --i)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define F first
#define S second

void cal(string s, string x, string y, map<pair<string, string>, ll>& a) {
	if(sz(s) == 0) {
		a[mp(x,y)]++;
		return;
	}
	cal(s.substr(1), x + s.substr(0,1), y, a);
	cal(s.substr(1), x, y + s.substr(0,1), a);
}

ll solve(string s, string t) {
	map<pair<string, string>, ll> a, b;
	string x,y;
	x = y = "";
	cal(s,x,y,a);
	cal(t,x,y,b);
	ll ret = 0;
	for(auto e : a) {
		auto key = e.F;
		if(b.find(key) != b.end()) {
			ret += e.S * b[key];
		}
	}
	return ret;
}



int main(void) {
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	//freopen("in.txt", "r", stdin);
	int n;
	string s;
	cin >> n >> s;
	string t = s.substr(n);
	reverse(all(t));
	cout << solve(s.substr(0,n), t) << '\n';
}