require 'set'

N = gets.chomp.to_i

s_c_hash = {}

u_set = Set.new
prev_size = 0
ret = 0

N.times do
  e = gets.chomp.split('').sort!.join('')
  u_set << e
  if prev_size != u_set.size
    s_c_hash[e.to_sym] = 1
    prev_size += 1
    ret += 1
  else
    s_c_hash[e.to_sym] += 1
  end
end

print ret
