n = gets.to_i
arr = []
n.times do 
	arr << gets.chomp.split('').sort.join('')
end
cnt = 0
sum = arr.group_by(&:itself).map do |k,v| 
  if v.count == 1
    0
  else
	v.count - 1
  end
end.inject(:+)
puts sum >= 1 ? sum+=1 : 0