p=(""+require("fs").readFileSync(0)).split`
`
n=+p[0]
s=p[1]
m={}
for(b=1<<n;b--;){u=0
for(i=n;i--;)u=b&(1<<i)?s[i]+u:u+s[i]
m[u]=-~m[u]}a=0
for(b=1<<n;b--;){u=0
for(i=n;i--;)u=b&(1<<i)?s[2*n+~i]+u:u+s[2*n+~i]
a+=~~m[u]}console.log(a)