#include<algorithm>
#include<vector>

using namespace std;

int function(int n, vector<int>& nums){
    int count = 0;
    int result = 0;
    for(int i = 0; i < n; i++){
        if(nums[i] <= nums[0]){
            count++;
        }
    }
    //cout<<count;
    while(count > 1){
        count = count / 2;
        result++;
    }
    return result;
}

int main(){
    int n;
    cin>>n;
    vector<int> input;
    for(int i = 0; i < n; i++){
        int temp;
        cin>>temp;
        input.push_back(temp);
    }
    cout<<function(n, input);
    return 0;
}