#include <bits/stdc++.h>
using namespace std;
#define rep(i, m, n) for (int i = m; i < (n); ++i)
#define rem(i, m, n) for (int i = m; i >= (n); --i)
typedef long long ll;

int main(){
  int N;
  string S;
  cin >> N >> S;
  string L = S.substr(0, N);
  string R = S.substr(N, 2 * N);
  reverse(R.begin(), R.end());
  map<pair<string, string>, ll> mp;
  ll ans = 0;
  rep(i, 0, 1 << N) {
    string r = "";
    string b = "";
    rep(j, 0, N) {
      if(i & (1 << j)) r += L[j];
      else b += L[j];
    }
    mp[{r, b}]++;
  }
  rep(i, 0, 1 << N) {
    string r = "";
    string b = "";
    rep(j, 0, N) {
      if(i & (1 << j)) r += R[j];
      else b += R[j];
    }
    ans += mp[{r, b}];
  }
  cout << ans << endl;
  return 0;
}
