#include <bits/stdc++.h>
using namespace std;
#define int long long

signed main() {
  int N;
  string s;
  cin >> N >> s;

  map<pair<string, string>, int> mp;
  for (int bit = 0; bit < (1 << N); bit++) {
    string r = "", b = "";
    for (int i = 0; i < N; i++) {
      if ((bit >> i) & 1) {
        r += s[i];
      } else {
        b += s[i];
      }
    }
    mp[{r, b}]++;
  }

  int ans = 0;
  for (int bit = 0; bit < (1 << N); bit++) {
    string r = "", b = "";
    for (int i = 0; i < N; i++) {
      if ((bit >> i) & 1) {
        r += s[N + i];
      } else {
        b += s[N + i];
      }
    }
    reverse(r.begin(), r.end());
    reverse(b.begin(), b.end());

    ans += mp[{r, b}];
  }

  cout << ans << endl;
  return 0;
}
