using System; using System.Collections.Generic; class Program { static void Main() { int N = int.Parse(Console.ReadLine()); string[] S = new string[N]; for (int i = 0; i < N; i++) { S[i] = Console.ReadLine(); } HashSet uniqueT = new HashSet(); for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { if (i != j) { uniqueT.Add(S[i] + S[j]); } } } Console.WriteLine(uniqueT.Count); } }