object Main {
  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)
    val n = sc.nextInt
    val s = List.fill(n)(sc.next.sorted)
    sc.close()

    println(counter(s, 0))

    def counter(xs: List[String], count: Int): Int = xs.isEmpty match {
      case true => count
      case _    => counter(xs.tail, count + xs.count(_ == xs.head) - 1)
    }
  }
}