local n=io.read("n","l")
local s=io.read()

local precheck=true
local t={s:byte(1,2*n)}
table.sort(t)
for i=1,2*n-1,2 do
    if t[i]~=t[i+1] then
        precheck=false
    end
end
if not precheck then
    print(0)
    return
end

local rmap={}
local bmap={}
for bit=0,(1<<n)-1 do
    local r1=""
    local r2=""
    local b1=""
    local b2=""
    for i=0,n-1 do
        if bit&(1<<i)>0 then
            local r=i+1
            local b=i+1+n
            r1=r1.." "..s:byte(r)
            b2=s:byte(b).." "..b2
        else
            local r=i+1
            local b=i+1+n
            b1=s:byte(b).." "..b1
            r2=r2.." "..s:byte(r)
        end
    end
    local rkey=r1.."/"..r2
    local bkey=b1.."/"..b2
    rmap[rkey]=(rmap[rkey] or 0)+1
    bmap[bkey]=(bmap[bkey] or 0)+1
end

local combination=0
for k,_ in pairs(rmap) do
    combination=combination+rmap[k]*(bmap[k] or 0)
end
print(combination)