import scala.collection.mutable
import scala.collection.mutable.ArrayBuffer
import scala.collection.mutable.Map

object Main{
  def main(args: Array[String]) : Unit = {
    val arr1 = io.StdIn.readLine().split(' ')
    val n = arr1(0).toInt

    val all = (0 until n).map{
      i =>
        val s = io.StdIn.readLine().toString
        s.sorted
    }
    
    var map = mutable.Map.empty[String, Int]

    all.foreach{
      str =>
        if(map.contains(str)){
          map(str) = map(str) + 1
        }else{

          map = map.updated(str, 0)
        }
    }

    var max: Long = map.values.sum + map.count(i => i._2 != 0) - 1

    if(max < 0) max = 0
    println(max)
  }
}