N = int(input()) nums = [int(x) for x in input().split()] num_type = set(nums) if len(num_type) == N: newly = N else: newly = 0 current = None while nums: current = nums.pop(0) if current in nums: idxs = [] for idx,num in enumerate(nums): if num == current: idxs.insert(0,idx) for idx in idxs: del nums[idx] else: newly +=1 print(newly)