#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using pii = pair<int, int>;
template <typename T>
using Vec = vector<T>;
template <typename T>
bool in_range(T x, T lb, T ub) {
  return lb <= x && x < ub;
}
template <typename T>
bool in_range(T x, T y, T lb, T ub) {
  return in_range(x, lb, ub) && in_range(y, lb, ub);
}
template <typename T>
void modAdd(T& a, T b, T mod) {
  a = (a + b + mod) % mod;
}
template <typename T>
void modMul(T& a, T b, T mod) {
  a = (a * b) % mod;
}
template <typename T>
void minUpdate(T& a, T b) {
  a = min(a, b);
}
template <typename T>
void maxUpdate(T& a, T b) {
  a = max(a, b);
}
int bitCount(int x) { return __builtin_popcount(x); }
int bitCount(lint x) { return __builtin_popcountll(x); }
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1},
          Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
const double EPS = 1e-9;
const double PI = acos(-1);
const unsigned long long BASE = 1e9 + 7;
unsigned long long mul[20];
unsigned long long makeHash(const string& S) {
  int n = S.size();
  unsigned long long res = 0;
  for (int i = (0); i < (n); ++i) res = res * BASE + S[i];
  return res;
}
int N;
string S;
map<pair<unsigned long long, unsigned long long>, lint> hash_count;
void makeHashCount() {
  for (int T = (0); T < (1 << N); ++T) {
    string X = "", Y = "";
    for (int i = (0); i < (N); ++i) {
      if ((T >> i) & 1)
        X += S[i];
      else
        Y += S[i];
    }
    reverse((Y).begin(), (Y).end());
    unsigned long long hashX = makeHash(X), hashY = makeHash(Y);
    hash_count[pair<unsigned long long, unsigned long long>(hashX, hashY)]++;
  }
}
void solve() {
  makeHashCount();
  lint ans = 0;
  for (int T = (0); T < (1 << N); ++T) {
    string X = "", Y = "";
    for (int i = (0); i < (N); ++i) {
      if ((T >> i) & 1)
        X += S[i + N];
      else
        Y += S[i + N];
    }
    reverse((Y).begin(), (Y).end());
    unsigned long long hashX = makeHash(X), hashY = makeHash(Y);
    ans +=
        hash_count[pair<unsigned long long, unsigned long long>(hashY, hashX)];
  }
  cout << ans << endl;
}
int main() {
  cin >> N;
  cin >> S;
  solve();
}
