n = gets.to_i
s = Array.new(1, Array.new(2))
s[0][0] = gets.chomp.sort
s[0][1] = 0
(n-1).times do
  ex = false
  tmp = gets.chomp.sort
  s.each do |str, num|
    if str == tmp
      num += num if num != 0
      num += 1 if num == 0
      ex = true
    end
  end
  if ex == false
    s.push([tmp, 0])
  end
end
ans = 0
s.each do |str, num|
  ans += num
end
puts ans