n=int(input()) s=[] for i in range(n): s.append(input()) t=[] for i in range(n): for j in range(n): if i!=j: t.append(s[i]+s[j]) st=set(t) print(len(st))