#include<bits/stdc++.h>
using namespace std;
int a[1000005]={0};
long long s = 0, x = 0, i, n, b;
int main()
{
cin >> n;
for (i = 0; i < n; i++)
{
cin >> b;
a[b]++;
}
for (i = 0; i < n; i++)
{
if (a[i] > 2)
s += a[i] - 2;
else if (a[i] == 1)
x++;
}
if (s >= x)
cout << s;
else
cout << (s+x+1)/2
return 0;
}