using System.Collections.Generic; using System; public class Hello { static void Main() { var n = int.Parse(Console.ReadLine().Trim()); var s = new string[n]; for (int i = 0; i < n; i++) s[i] = Console.ReadLine().Trim(); getAns(n, s); } static void getAns(int n, string[] s) { var hs = new HashSet(); for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) { if (i == j) continue; hs.Add(s[i] + s[j]); } Console.WriteLine(hs.Count); } }