n = gets.to_i ss = n.times.map { gets.chomp } puts ss.permutation(2).map { _1 + _2 }.uniq.size