lst = [] n = int(input()) for i in range(0..n): lst[i] = input() dic = {} for i in range(0,n): for j in range(0..n): if i == j: continue s = lst[i] + lst[j] if s in dic: continue dic[s] = s print(count(dic))