

object Main extends App {

  val n = scala.io.StdIn.readInt()
  val s = scala.io.StdIn.readLine()

  def solve(): Long = {
    val combinationSeq: Seq[Seq[Int]] = (0 until n).combinations(3).toVector
    val sArr: Array[String] = s.split("")
    combinationSeq.map { list =>
      s"${sArr(list(0))}${sArr(list(1))}${sArr(list(2))}"
    }.toSet.size
  }
  println(solve)

}
