n = int(input()) tmp = [0] * n for i in range(n): tmp[i] = input() ans = set() for i in range(n): for j in range(n): if i == j: continue ans.add(tmp[i]+tmp[j]) print(len(ans))