N = int(raw_input()) input = sorted(raw_input().strip().split()) cnt = 0 while input: top = input.pop(0) if input: nxt = input[0] if top == nxt: while True: try: if input.index(top) == 0: input.remove(top) except: break else: cnt += 1 print cnt