def main(): str_list = [] a = int(input()) for i in range(a): str_list.append(input()) check_list = [txt1+txt2 for i, txt1 in enumerate(str_list) for j, txt2 in enumerate(str_list) if i is not j] s = set(check_list) print(len(list(s))) if __name__ == "__main__": main()