import java.io._
import java.util.StringTokenizer
import scala.util.control.Breaks.{breakable,break}
import scala.collection.mutable.Map

object Main extends App {
  val in = new InputReader(System.in)
  val pw = new PrintWriter(System.out)

  private[this] val N = in.next().toInt
  private[this] val S = in.next()

  private[this] val left = S.substring(0, N)
  private[this] val right = S.substring(N, 2*N).reverse

  private[this] val dp1: Map[(String, String), Long] = Map()
  private[this] val dp2: Map[(String, String), Long] = Map()

  for(k <- 0 until Math.pow(2, N).round.toInt) {
    val tmp = k.toBinaryString
    val cond: String = "0"*(N - tmp.length) + tmp

    val l1 = new StringBuilder()
    val l2 = new StringBuilder()
    val r1 = new StringBuilder()
    val r2 = new StringBuilder()
    for(i <- 0 until N) {
      if(cond(i) == '0') {
        r1.append(left(i))
        r2.append(right(i))
      }
      else {
        l1.append(left(i))
        l2.append(right(i))
      }
    }

    val key1 = (l1.toString, r1.toString)
    val key2 = (l2.toString, r2.toString)
    if(dp1.contains(key1)) {
      dp1(key1) += 1
    }
    else {
      dp1 += ((key1, 1))
    }

    if(dp2.contains(key2)) {
      dp2(key2) += 1
    }
    else {
      dp2 += ((key2, 1))
    }
  }

  // val _ = ???

  var ans = 0L
  for((key, v1) <- dp1) {
    if(dp2.contains(key)) {
      ans += v1 * dp2(key)
    }
  }
  println(ans)
}


class InputReader(stream: InputStream) {
  private val reader = new BufferedReader(new InputStreamReader(stream))
  private var tokenizer: StringTokenizer = new StringTokenizer(reader.readLine())
  def next(): String = {
    while (!tokenizer.hasMoreTokens()) {
      tokenizer = new StringTokenizer(reader.readLine())
    }
    tokenizer.nextToken()
  }
}

