#include <iostream>
#include<bits/stdc++.h>

using namespace std;


bool check(vector<int> &arr,int mid){
	int n = arr.size();
	int i = n-mid;

	int j=0;
	
	while(i<n){
		if(arr[j]>=arr[i]){
			return false;
		}
		i++;
		j++;
	}
	return true;
	
}
int main() {
	// your code goes here
	int n;
	vector<int> arr(n);
	for(int i=0;i<n;i++){
		cin>>arr[i];
	}
	
	sort(arr.begin(),arr.end());
	int low=0;
	int high=n-1;
	int ans=0;
	
	while(low<=high){
		cout<<"yes";
		int mid = (low+high)/2;
		
		if(check(arr,mid)==true){
			ans = mid;
			low=mid+1;
			
		}
		else{
			high=mid-1;
			
		}
	}
	cout<<ans<<endl;
	return 0;
}