n = gets.strip.to_i
s = n.times.map{ gets.strip.split('') }

ords = []
('a'.ord*10..'z'.ord*10).each do |i|
  ords[i] = 0
end

s.each do |st|
  num = 0
  st.map{|m| num += m.ord}
  ords[num] += 1
end

ans = 0
('a'.ord*10..'z'.ord*10).each do |i|
  ans += (ords[i]*(ords[i]-1))/2  if ords[i] > 0
end

puts ans


