#include <algorithm>
#include <iostream>
#include <vector>

int main() {
	std::ios_base::sync_with_stdio(false);
	std::cin.tie(nullptr);
	int n;
	std::cin >> n;
	std::vector<int> z(n);
	for (int i = 0; i < n; i++) {
		std::cin >> z[i];
	}
	std::sort(z.begin(), z.end());
	int available = 0;
	int previous = 0;
	int result = 0;
	for (int i = n - 1; i >= 0; i--) {
		available++;
		if (z[i] == previous && available >= 4) {
			result++;
			available -= 4;
			previous = 0;
		} else {
			previous = z[i];
		}
	}
	std::cout << result << '\n';
	return 0;
}
