let cache = new System.Collections.Generic.Dictionary<_,_>()
let sum s =
    match cache.TryGetValue s with
    | true, v -> cache.Remove(s) |> ignore; cache.Add(s, v + (v + 1))
    | false, _ -> cache.Add(s, 0)

let n = stdin.ReadLine() |> int
[for i in 1..n do stdin.ReadLine() |> Seq.toList |> List.sort |> sum]
cache.Values
|> Seq.sum
|> printfn "%d"
