#include<bits/stdc++.h>
using namespace std;
map<int,int> m1;
int main(){
int n;
cin>>n;
for(int i=1;i<=n;i++){
int temp;
cin>>temp;
m1[temp]++;
}
long long ans=0,temp2=1,a[n]={0};
for(auto it=m1.begin();it!=m1.end();it++){
a[temp2]=it->second;
ans+=a[temp2];
ans-=min(a[temp2-1],a[temp2]);
temp2++;
}
cout<<ans;
return 0;
}