object Main {

  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)
    val N = sc.nextInt()
    val S = sc.next()
    println(cnt(S, Map[Char, Boolean]()) - 1)
  }

  def cnt(str: String, chars: Map[Char, Boolean]): Long = {
    if (str.isEmpty) 1
    else {
      val h = str.head
      if (chars.getOrElse(h, false))
        cnt(str.tail, chars + (h -> false))
      else
        cnt(str.tail, chars + (h -> true)) + cnt(str.tail, chars + (h -> false))
    }
  }
}
