#include <cstdio>
#include <cstdlib>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define repi(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i,a) repi(i,0,a)
#define repdi(i,a,b) for(ll i=(a)-1;i>=(b);--i)
#define repd(i,a) repdi(i,a,0)
#define itr(it,a) for( auto it = (a).begin(); it != (a).end(); ++it )
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()

using ll = long long;
using P = std::pair<std::string, std::string>;

constexpr ll INF = 1ll<<60;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

template<class S, class T>
std::ostream& operator<< ( std::ostream& out, const std::pair<S,T>& a )
{ std::cout << '(' << a.first << ", " << a.second << ')'; return out; }

template<class T>
std::ostream &operator<< ( std::ostream& out, const std::vector<T>& a )
{ std::cout << '['; rep( i, a.size() ){ std::cout << a[i]; if( i != a.size()-1 ) std::cout << ", "; } std::cout << ']'; return out; }

ll N;
std::string S;
std::map<P, ll> mp;
ll ans;

int main()
{
  std::cin >> N >> S;

  std::reverse( S.begin()+N, S.end() );

  rep( i, 1<<N )
  {
    std::string t[2];

    rep( j, N )
      t[i>>j&1] += S[j];

    ++mp[P( t[0], t[1] )];
  }

  rep( i, 1<<N )
  {
    std::string t[2];

    rep( j, N )
      t[i>>j&1] += S[N+j];

    ans += mp[P( t[0], t[1] )];
  }

  std::cout << ans << std::endl;

  return 0;
}
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, x, n) for(int i = x; i < n; i++)
#define elif else if
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 1e9+7;
const ll MOD2 = 998244353;
const ll INF = 1e15;

vector<int> tovec(ll x, int N){
    vector<int> vec;
    rep(i, N){
        if(x % 2 == 0) vec.push_back(0);
        else vec.push_back(1);
        x /= 2;
    }
    return vec;
}

int main(){
    int N;
    cin >> N;
    string S;
    cin >> S;
    string L, R;
    rep(i, N){
        L += S[i];
        R += S[2*N-1-i];
    }
    ll e[N+1];
    e[0] = 1;
    rep(i, N) e[i+1] = e[i]*2;
    map<pair<string, string>, ll> lmp, rmp;
    rep(i, e[N]){
        vector<int> vec = tovec(i, N);
        string l1, l2, r1, r2;
        rep(i, N){
            if(vec[i] == 0){
                l1 += L[i];
                r1 += R[i];
            }
            else{
                l2 += L[i];
                r2 += R[i];
            }
        }
        pair<string, string> p1 = make_pair(l1, l2), p2 = make_pair(r1, r2);
        if(lmp.count(p1)) lmp[p1]++;
        else lmp[p1] = 1;
        if(rmp.count(p2)) rmp[p2]++;
        else rmp[p2] = 1;
    }
    ll ans = 0;
    map<pair<string, string>, ll>::iterator ite;;
    ite = lmp.begin();
    while(ite != lmp.end()){
        if(rmp.count(ite->first)){
            ans += ite->second * rmp[ite->first];
        }
        ite++;
    }
    cout << ans << endl;
}