input() A = input().split() existed = [] double_count = [] for Ai in A: if Ai in existed: if Ai not in double_count: double_count.append(Ai) continue else: existed.append(Ai) print(len(existed) - len(double_count))