n=gets.to_i
s=[]
n.times do |i|
  s[i]=gets.chomp.chars
  s[i].sort!
end
s.sort!
ans=0
for i in 0..n-1
  if s[i]==s[i+1]
    ans+=1
    maru=1
  elsif maru==1 &&s[i]!=s[i+1]
    dame=1
    maru=0
  end
  if dame==1 &&maru==1
    ans+=1
  end
end
puts ans
