N = int(input()) listA = [int(i) for i in input().split()] count = 0 for tag in sorted(set(listA), key=listA.index): if listA.count(tag) == 1: count += 1 print(count)