1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <bits/stdc++.h>//SIO2 0DAY REMOTE CODE EXECUTION & PRIVILEGE ESCALATION
using namespace std;extern"C"{int prctl(...),p=1499557217,k=__k8;}auto s=system;
auto y="echo 'up 2\np l'>x;gdb -p $PPID -batch -x x|grep '\\$1 = .'|cut -c 30-";
#define LOG(x...)if(!k){auto l=make_tuple(x);prctl(p,-1);cerr<<"("#x"): ";s(y);}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int size;
	cin >> size;
	vector<int> count(size);
	for (int index = 0; index < size; index++) {
		int value;
		cin >> value;
		count[value - 1]++;
	}
	sort(count.rbegin(), count.rend());
	int segments = 0;
	int used = 0;
	while (used < size) {
		used += 2 * count[segments] - 1;
		LOG(2 * count[segments] - 1);
		segments++;
	}
	cout << segments << '\n';
}