bzoj#P3547. Matchings

Matchings

题目描述

给定 nn 个整数 a1,…,ana_1,\dots,a_n。现在要把它们两两配对,要求同一对里两个数相等。每个数最多用一次。

请输出最多能配成多少对。

输入格式

第一行一个整数 nn(1≤n≤800001\le n\le 80000)。 第二行 nn 个整数 aia_i(1≤ai≤1061\le a_i\le 10^6)。

输出格式

输出一行一个整数,表示最多能配成的对数。

样例输入

7
1 2 1 2 3 3 3

样例输出

3