object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n = sc.nextInt
  val list = List.fill(n)(sc.next)

  def GreenBin(l: List[String]): Int = {
    val s = "aaa"
    val ar = l
      .map(x => x.groupBy(v => v)).toArray
    val length = ar.length
    val r = for {
      i <- (0 to length - 1)
      j <- (0 to length - 1)
      if i != j && ar(i) == ar(j)
    } yield
      if (i < j) (i, j)
      else (j, i)
    r.toSet.size
  }
  println(GreenBin(list))
}