#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
const int MAXN = 1e5 + 10;
LL r[MAXN];
LL n;
LL cnt = 0;
int main()
{
cin >> n;
for (int i = 1 ; i <= n ; ++i) cin >> r[i];
sort(r+1,r+n+1);
LL pos = 2;
while(r[pos] <= r[1]) pos++;
LL k = 1;
while (pos != n + 1)
{
if (r[pos] > r[k])
{
k++;
pos++;
cnt++;
}
else pos++;
}
LL ans = n - cnt;
cout << ans << "\n";
return 0;
}