N = gets.to_i strings = Set.new (1..N).each do s = gets.chomp strings << s end puts strings.to_a.permutation(2).map { _1 + _2 }.uniq.size