function Main(input) {
  input = input.split("\n");
  var n = Number(input[0]);
  input.shift();
  var strArray = input;
  var alphArray = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y"];
  //zは不要

  var countArray = [];
  var outputCount = 0;
  var counter = function(str,seq){
    return str.split(seq).length - 1;
  }
  
  strArray.forEach(function(strValue){
    var tempArray = [];
    var returnCount = 0;
    alphArray.forEach(function(alphValue){
      returnCount = returnCount + counter(strValue,alphValue);
      if(returnCount === 10){
        return;
      }
      tempArray.push(counter(strValue,alphValue));
      
    });
    countArray.push(tempArray);
  });
  
  for(var i = 0 ; i < n-1 ; i ++){
    for(var j = i+1 ; j < n ; j ++){
      if(countArray[i].toString() === countArray[j].toString()){
        outputCount ++;
      }
    }
  }
  
  console.log(outputCount);
}
 
Main(require("fs").readFileSync("/dev/stdin", "utf8"));