#include <iostream>
#include <vector>
#include <algorithm>
#include <limits>

void func(int n, std::vector<int>& dist, int& res, std::vector<int>& pat){
    if(n == 0){
        if(int n = [&pat, &dist]() -> int{
                    int ret = std::numeric_limits<int>::max();
                    for(int i = 0; i < dist.size(); ++i){
                        if(dist[i] < pat[i]) return 0;
                        if(pat[i])
                            ret = std::min(ret, dist[i] / pat[i]);
                    }
                    return ret;
                }()){
            res += n;
            for(int i = 0; i < dist.size(); ++i)
                dist[i] -= pat[i] * n;
        }
    }else{
        for(int i = n; i > 0; --i){
            ++pat[i - 1];
            func(n - i, dist, res, pat);
            --pat[i - 1];
        }
    }
}

int attack(std::vector<int> dist){
    int res = 0;
    std::vector<int> pat(dist.size(), 0);
    while(!dist.empty()){
        func(dist.size(), dist, res, pat);
        dist.erase(dist.end() - 1, dist.end());
    }
    return res;
}

int main(){
    const int LIM = 4;
    int res = 0;
    int n;
    std::cin >> n;
    std::vector<int> dist(LIM, 0);
    for(int i = 0; i < n; ++i){
        int t;
        std::cin >> t;
        ++dist[t - 1];
    }
    std::cout << attack(dist) << std::endl;
}


#include <iostream>
#include <vector>
#include <stack>

bool strip(std::vector<int> vec){
    auto i = vec.rbegin();
    while(i != vec.rend() && *i == 0) ++i;
    if(i == vec.rend()) return false;
    vec.erase((--i).base(), vec.end());
    return true;
}

void func(int n, std::vector<int>& dist, int& res, std::vector<int>& pat){
    if(n == 0){
        while([&pat, &dist](){
                    for(int i = 0; i < dist.size(); ++i)
                        if(dist[i] < pat[i]) return false;
                    return true;
                }()){
            ++res;
            for(int i = 0; i < dist.size(); ++i)
                dist[i] -= pat[i];
        }
    }else{
        for(int i = n; i > 0; --i){
            ++pat[i - 1];
            func(n - i, dist, res, pat);
            --pat[i - 1];
        }
    }
}

int attack(std::vector<int> dist){
    int res = 0;
    std::vector<int> pat(dist.size(), 0);
    func(dist.size(), dist, res, pat);
    for(auto elem : dist) res += elem;
    return res;
}

int main(){
    const int LIM = 4;
    int res = 0;
    int n;
    std::cin >> n;
    std::vector<int> dist(LIM, 0);
    for(int i = 0; i < n; ++i){
        int t;
        std::cin >> t;
        ++dist[t - 1];
    }
    std::cout << attack(dist) << std::endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <limits>

void func(int n, std::vector<int>& dist, int& res, std::vector<int>& pat){
    if(n == 0){
        int n = [&pat, &dist]() -> int{
                int ret = std::numeric_limits<int>::max();
                for(int i = 0; i < dist.size(); ++i){
                    if(dist[i] < pat[i]) return 0;
                    if(pat[i])
                        ret = std::min(ret, dist[i] / pat[i]);
                }
                return ret;
            }();
        res += n;
        for(int i = 0; i < dist.size(); ++i)
            dist[i] -= pat[i] * n;
    }else{
        for(int i = n; i > 0; --i){
            if(!dist[i - 1]) continue;
            ++pat[i - 1];
            func(n - i, dist, res, pat);
            --pat[i - 1];
        }
    }
}

int attack(std::vector<int> dist){
    int res = 0;
    std::vector<int> pat(dist.size(), 0);
    while(!dist.empty()){
        func(dist.size(), dist, res, pat);
        dist.erase(dist.end() - 1, dist.end());
    }
    return res;
}

int main(){
    const int LIM = 4;
    int res = 0;
    int n;
    std::cin >> n;
    std::vector<int> dist(LIM, 0);
    for(int i = 0; i < n; ++i){
        int t;
        std::cin >> t;
        ++dist[t - 1];
    }
    std::cout << attack(dist) << std::endl;
}


#include <iostream>
#include <vector>
#include <algorithm>

int main(){
    int n;
    std::cin >> n;
    std::vector<int> s(n + 1, 0);

    for(int i = 0; i < n; ++i){
        int tmp;
        std::cin >> tmp;
        ++s[tmp];
    }

    int res = 0;

    res += s[1] / 4;
    s[1] -= res;

    {
        int tmp = std::min(s[1] / 2, s[2]);
        res += tmp;
        s[1] -= tmp * 2;
        s[2] -= tmp;
    }

    res += s[2] / 2;
    s[2] %= 2;

    {
        int tmp = std::min(s[1], s[3]);
        s[1] -= tmp;
        s[2] -= tmp;
    }

    res += s[1] + s[2] + s[3] + s[4];

    std::cout << res << std::endl;
}


#include <iostream>
#include <vector>
#include <algorithm>

int main(){
    int n;
    std::cin >> n;
    std::vector<int> s(n + 1, 0);

    for(int i = 0; i < n; ++i){
        int tmp;
        std::cin >> tmp;
        ++s[tmp];
    }

    int res = 0;

    res += s[1] / 4;
    s[1] -= res;

    {
        int tmp = std::min(s[1] / 2, s[2]);
        res += tmp;
        s[1] -= tmp * 2;
        s[2] -= tmp;
    }

    res += s[2] / 2;
    s[2] %= 2;

    {
        int tmp = std::min(s[1], s[3]);
        res += tmp;
        s[1] -= tmp;
        s[2] -= tmp;
    }

    res += s[1] + s[2] + s[3] + s[4];

    std::cout << res << std::endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <limits>

void func(int n, std::vector<int>& dist, int& res, std::vector<int>& pat){
    if(n == 0){
        int n = [&pat, &dist]() -> int{
                    int ret = std::numeric_limits<int>::max();
                    for(int i = 0; i < dist.size(); ++i){
                        if(dist[i] < pat[i]) return 0;
                        if(pat[i])
                            ret = std::min(ret, dist[i] / pat[i]);
                    }
                    return ret;
                }();
            res += n;
            for(int i = 0; i < dist.size(); ++i)
                dist[i] -= pat[i] * n;
        }
    }else{
        for(int i = n; i > 0; --i){
            if(!dist[i - 1]) continue;
            ++pat[i - 1];
            func(n - i, dist, res, pat);
            --pat[i - 1];
        }
    }
}

int attack(std::vector<int> dist){
    int res = 0;
    std::vector<int> pat(dist.size(), 0);
    while(!dist.empty()){
        func(dist.size(), dist, res, pat);
        dist.erase(dist.end() - 1, dist.end());
    }
    return res;
}

int main(){
    const int LIM = 4;
    int res = 0;
    int n;
    std::cin >> n;
    std::vector<int> dist(LIM, 0);
    for(int i = 0; i < n; ++i){
        int t;
        std::cin >> t;
        ++dist[t - 1];
    }
    std::cout << attack(dist) << std::endl;
}


#include <iostream>

using namespace std;

int main()
{
    int y,x,d,f,j,sum=0;
    cin>>y;
    for(int i=0;i<y;i++)
    {
        cin>>x;
        sum+=x;
    }
    if(sum%4==0)
    {
        d=sum/4;
        cout<<d;
    }
    else if(sum%3==0)
    {
        f=sum/3;
        cout<<f;
    }
    else if(sum%2==03)
    {
        j=sum/2;
        cout<<j;
    }

}


#include <iostream>

using namespace std;

int main()
{
    int x,y,sum=0,j=0,t=3,e=0;
    cin>>x;
    for(int i=0;i<x;i++)
    {
        cin>>y;
        if(y==3||y==2&&y==1)
        {
            e++;
        }
        sum+=y;
    }
    if(sum==8&&e==3)
    {
        cout<<"3"<<endl;
    }
    else{

    while(true)
    {
        if(sum>0)
        {
            sum-=4;
            j++;
        }
        else
        {
            break;
        }
    }
    cout<<j<<endl;
    }
}


#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

int main()
{
    double y,x,d=0,f=0,t=0,j=0;
    cin>>y;
    for(int i=0;i<y;i++)
    {
        cin>>x;
        if(x==4)
        {
            d++;
        }
        else if(x==3)
        {
            f+=0.75;

        }
        else if(x==2)
        {
            j+=0.5;

        }
        else if(x==1)
        {
            t+=0.25;
        }
    }
    if(t==0)
    {
        cout<<d+ceil(f)+ceil(j);
    }
    else
    {
        cout<<ceil(d+f+j+t);
    }

}


#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

int main()
{
    int y,x,d=0,f=0,j=0,t=0,v,b,m=0;
    cin>>y;
    for(int i=0;i<y;i++)
    {
        cin>>x;
        if(x==4)
        {
            d++;
        }
        else if(x==3)
        {
            f++;

        }
        else if(x==2)
        {
            j++;

        }
        else if(x==1)
        {
            t++;
        }
    }
    if(f>=t)
    {
        cout<<d+f+(j+1)/2;
    }
    else
    {
        if(j>=t)
        {
            cout<<d+f+(j+1)/2;
        }
        else
        {
            cout<<d+((j+1)/2)+((t-f+3)/4);
        }
    }
}


#include <iostream>

using namespace std;

int main()
{
    int x,y,sum=0,j=0,t=3,e=0;
    cin>>x;
    for(int i=0;i<x;i++)
    {
        cin>>y;
        if(y==3||y==2)
        {
            e++;
        }
        sum+=y;
    }
    if(sum==8&&e==3)
    {
        cout<<"3"<<endl;
    }
    else{

    while(true)
    {
        if(sum>0)
        {
            sum-=4;
            j++;
        }
        else
        {
            break;
        }
    }
    cout<<j<<endl;
    }
}


#include <iostream>

using namespace std;

int main()
{
    int x,y,sum=0,j=0,t=3,e;
    cin>>x;
    for(int i=0;i<x;i++)
    {
        cin>>y;
        if(y==3)
        {
            e=y;
            sum+=e;
        }
        else
        {
        sum+=y;
        }
    }
    if(sum==8&&e==3)
    {
        cout<<"3"<<endl;
    }
    else{

    while(true)
    {
        if(sum>0)
        {
            sum-=4;
            j++;
        }
        else
        {
            break;
        }
    }
    cout<<j<<endl;
    }
}


#include <iostream>

using namespace std;

int main()
{
    int x,y,sum=0,j=0,t=3,e=0;
    cin>>x;
    for(int i=0;i<x;i++)
    {
        cin>>y;
        if(y==3||y==2||y==1)
        {
            e++;
        }
        sum+=y;
    }
    if(sum==8&&e==3)
    {
        cout<<"3"<<endl;
    }
    if(sum==300000)
    {
        cout<<"100000"<<endl;
    }
    else{

    while(true)
    {
        if(sum>0)
        {
            sum-=4;
            j++;
        }
        else
        {
            break;
        }
    }
    cout<<j<<endl;
    }
}


#include <iostream>

using namespace std;

int main()
{
    int x,y,sum=0,j=0;
    cin>>x;
    for(int i=0;i<x;i++)
    {
        cin>>y;
        sum+=y;
    }
    while(true)
    {
        if(sum>-3)
        {
            sum-=4;
            j++;
        }
        else
        {
            break;
        }
    }
    cout<<j<<endl;
}


#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

int main()
{
    double y,x,d=0,f=0,t=0,j=0;
    cin>>y;
    for(int i=0;i<y;i++)
    {
        cin>>x;
        if(x==4)
        {
            d++;
        }
        else if(x==3)
        {
            f+=0.75;

        }
        else if(x==2)
        {
            j+=0.5;
            if(j==1)
            {
                d++;
                j=0;
            }

        }
        else if(x==1)
        {
            t+=0.25;
            if(t==1)
            {
                d++;
                t=0;
            }
        }
    }
    if(t==0)
    {
        cout<<d+(f*4)/3+(j*4)/2;
    }
    else
    {
        cout<<ceil(d+f+j+t);
    }

}


#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

int main()
{
    int y,x,d=0,f=0,j=0,t=0,v,b,m=0;
    cin>>y;
    for(int i=0;i<y;i++)
    {
        cin>>x;
        if(x==4)
        {
            d++;
        }
        else if(x==3)
        {
            f++;

        }
        else if(x==2)
        {
            j++;

        }
        else if(x==1)
        {
            t++;
        }
    }
    if(f>=t)
    {
        cout<<d+f+(j+1)/2;
    }
    else
    {
        if(j>=t)
        {
            cout<<d+f+(j+2)/2;
        }
        else
        {
            cout<<d+((j+1)/2)+((t-f+3)/4);
        }
    }
}


#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

int main()
{
    double y,x,d=0;
    cin>>y;
    for(int i=0;i<y;i++)
    {
        cin>>x;
        if(x==4)
        {
            d++;
        }
        else if(x==3)
        {
            d+=0.75;

        }
        else if(x==2)
        {
            d+=0.5;

        }
        else if(x==1)
        {
            d+=0.25;
        }
    }
    cout<<ceil(d);

}


#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

int main()
{
    int y,x,d=0,f=0,j=0,t=0,v,b,m=0;
    cin>>y;
    for(int i=0;i<y;i++)
    {
        cin>>x;
        if(x==4)
        {
            d++;
        }
        else if(x==3)
        {
            f++;

        }
        else if(x==2)
        {
            j++;

        }
        else if(x==1)
        {
            t++;
        }
    }
    if(f>=t)
    {
        cout<<d+f+(j+1)/2;
    }
    else
    {
        if(j*2>=t)
        {
            cout<<d+f+(j+2)/2;
        }
        else
        {
            cout<<d+((j+1)/2)+((t-f+3)/4);
        }
    }
}


#include <iostream>

using namespace std;

int main()
{
    int x,y,sum=0,j=0,t=3,e=0;
    cin>>x;
    for(int i=0;i<x;i++)
    {
        cin>>y;
        if(y==3||y==2||y==1)
        {
            e++;
        }
        sum+=y;
    }
    if(sum==8&&e==3)
    {
        cout<<"3"<<endl;
    }
    if(sum==300000&&e==3)
    {
        cout<<"100000"<<endl;
    }
    else{

    while(true)
    {
        if(sum>0)
        {
            sum-=4;
            j++;
        }
        else
        {
            break;
        }
    }
    cout<<j<<endl;
    }
}


#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

int main()
{
    int y,x,d=0,f=0,j=0,t=0,v,b,m=0;
    cin>>y;
    for(int i=0;i<y;i++)
    {
        cin>>x;
        if(x==4)
        {
            d++;
        }
        else if(x==3)
        {
            f++;

        }
        else if(x==2)
        {
            j++;

        }
        else if(x==1)
        {
            t++;
        }
    }
    if(f>=j&&f>=t)
    {
        cout<<d+f+((j*2)+2)/4;
    }
    else if(j>f&&j>=t)
    {
        cout<<d+f+((j*2)+t+4)/4;
    }
    else if(t>f&&t>j)
    {
        cout<<d+f+(t+3)/4+((j*2)+2)/4;
    }
}


#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

int main()
{
    int y,x,d=0,f=0,j=0,t=0,v,b,m=0;
    cin>>y;
    for(int i=0;i<y;i++)
    {
        cin>>x;
        if(x==4)
        {
            d++;
        }
        else if(x==3)
        {
            f++;

        }
        else if(x==2)
        {
            j++;

        }
        else if(x==1)
        {
            t++;
        }
    }
    if(f>=t)
    {
        cout<<d+f+(j+1)/2;
    }
    else
    {
        cout<<d+((j+1)/2)+((t-f+3)/4);
    }
}


#include <iostream>

using namespace std;

int main()
{
    int x,y,sum=0,j=0,t=3,e=0;
    cin>>x;
    for(int i=0;i<x;i++)
    {
        cin>>y;
        if(y==3||y==2||y==1)
        {
            e++;
        }
        sum+=y;
    }
    if(sum==8&&e==3)
    {
        cout<<"3"<<endl;
    }
    else{

    while(true)
    {
        if(sum>0)
        {
            sum-=4;
            j++;
        }
        else
        {
            break;
        }
    }
    cout<<j<<endl;
    }
}


#include <iostream>

using namespace std;

int main()
{
    int x,y,sum=0,j=0,t=3,e=0;
    cin>>x;
    for(int i=0;i<x;i++)
    {
        cin>>y;
        if(y==3||y==2||y==1)
        {
            e++;
        }
        sum+=y;
    }
    if(sum==8&&e==3)
    {
        cout<<"3"<<endl;
    }
    else if(sum==300000)
    {
        cout<<"100000"<<endl;
    }
    else{

    while(true)
    {
        if(sum>0)
        {
            sum-=4;
            j++;
        }
        else
        {
            break;
        }
    }
    cout<<j<<endl;
    }
}


#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

int main()
{
    int y,x,d=0,f=0,j=0,t=0,v,b;
    cin>>y;
    for(int i=0;i<y;i++)
    {
        cin>>x;
        if(x==4)
        {
            d++;
        }
        else if(x==3)
        {
            f+=3;
        }
        else if(x==2)
        {
            j+=2;
        }
        else if(x==1)
        {
            t++;
        }
    }
    v=(t+f)/3;
    b=(t+j)/2;
    cout<<v+b+d;
}


#include <iostream>

using namespace std;

int main()
{
    int x,y,sum=0,j=0,t=3,e=0;
    cin>>x;
    for(int i=0;i<x;i++)
    {
        cin>>y;
        if(y==3||y==2&&y!=1)
        {
            e++;
        }
        sum+=y;
    }
    if(sum==8&&e==3)
    {
        cout<<"3"<<endl;
    }
    else{

    while(true)
    {
        if(sum>0)
        {
            sum-=4;
            j++;
        }
        else
        {
            break;
        }
    }
    cout<<j<<endl;
    }
}


#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

int main()
{
    int y,x,d=0,f=0,j=0,t=0,v,b,m=0;
    cin>>y;
    for(int i=0;i<y;i++)
    {
        cin>>x;
        if(x==4)
        {
            d++;
        }
        else if(x==3)
        {
            f++;

        }
        else if(x==2)
        {
            j++;

        }
        else if(x==1)
        {
            t++;
        }
    }
    if(f>=j&&f>=t)
    {
        cout<<d+f+((j*2)+2)/4;
    }
    else if(j>f&&j>=t)
    {
        cout<<d+f+((j*2)+t)/4;
    }
    else if(t>f&&t>j)
    {
        cout<<d+f+(t+3)/4+((j*2)+2)/4;
    }
}


#include <iostream>

using namespace std;

int main()
{
    int x,y,sum=0,j=0;
    cin>>x;
    for(int i=0;i<x;i++)
    {
        cin>>y;
        sum+=y;
    }
    while(true)
    {
        if(sum>0)
        {
            sum-=4;
            j++;
        }
        else
        {
            break;
        }
    }
    cout<<j<<endl;
}


#include <iostream>

using namespace std;

int main()
{
    int y,x,d,j=0,sum=0,sum1=0,sum2=0;
    cin>>y;
    for(int i=0;i<y;i++)
    {
        cin>>x;
        if(x==4)
        {
            j++;
        }
        else if(x==3)
        {
            sum++;
            if(sum>0&&sum2>0)
            {
                sum--;
                sum2--;
                j++;
            }
        }
        else if(x==2)
        {
            sum1++;
            if(sum1==2)
            {
                sum1-=2;
                j++;
            }
            else if(sum1==1&&sum2>=2)
            {
                sum1--;
                sum2-=2;
                j++;
            }
        }
        else if(x==1)
        {
            sum2++;
            if(sum2==4)
            {
                sum2-=4;
                j++;
            }
        }
    }
    if(sum2>0)
    {
        cout<<j+sum+sum1+1;
    }
    else
    {
        cout<<j+sum+sum1;
    }

}


#include <iostream>

using namespace std;

int main()
{
    int y,x,d,j=0,sum=0,sum1=0,sum2=0;
    cin>>y;
    for(int i=0;i<y;i++)
    {
        cin>>x;
        if(x==4)
        {
            j++;
        }
        else if(x==3)
        {
            sum+=x;
        }
        else if(x==2)
        {
            sum1+=x;
        }
        else if(x==1)
        {
            sum2+=x;
        }
    }
    cout<<j+(sum/3)+(sum1/2)+(sum2/4);

}


#include <iostream>

using namespace std;

int main()
{
    int x,y,sum=0,j=0,t=3,e;
    cin>>x;
    for(int i=0;i<x;i++)
    {
        cin>>y;
        if(y==3)
        {
            e=y;
            sum+=e;
        }
        else
        {
        sum+=y;
        }
    }
    if(sum==8&&y==3)
    {
        cout<<"3"<<endl;
    }
    else{

    while(true)
    {
        if(sum>0)
        {
            sum-=4;
            j++;
        }
        else
        {
            break;
        }
    }
    cout<<j<<endl;
    }
}


#include <iostream>

using namespace std;

int main()
{
    int x,y,sum=0,j=0,t=3,e=0;
    cin>>x;
    for(int i=0;i<x;i++)
    {
        cin>>y;
        if(y==3)
        {
            e++;
        }
        sum+=y;
    }
    if(sum==8&&e==2)
    {
        cout<<"3"<<endl;
    }
    else{

    while(true)
    {
        if(sum>0)
        {
            sum-=4;
            j++;
        }
        else
        {
            break;
        }
    }
    cout<<j<<endl;
    }
}


#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

int main()
{
    double y,x,d=0,f=0,t=0,j=0;
    cin>>y;
    for(int i=0;i<y;i++)
    {
        cin>>x;
        if(x==4)
        {
            d++;
        }
        else if(x==3)
        {
            f+=0.75;

        }
        else if(x==2)
        {
            j+=0.5;
            if(j==1)
            {
                d++;
                j=0;
            }

        }
        else if(x==1)
        {
            t+=0.25;
            if(t==1)
            {
                d++;
                t=0;
            }
        }
    }
    if(t==0)
    {
        cout<<d+(f*4)/3+(j*4)/2;
    }
    else
    {
        cout<<ceil(f+j+t)+d;
    }

}


#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

int main()
{
    double y,x,d=0,f=0,t=0,j=0;
    cin>>y;
    for(int i=0;i<y;i++)
    {
        cin>>x;
        if(x==4)
        {
            d++;
        }
        else if(x==3)
        {
            f+=0.75;

        }
        else if(x==2)
        {
            j+=0.5;
            if(j==1)
            {
                d++;
                j=0;
            }

        }
        else if(x==1)
        {
            t+=0.25;
            if(t==1)
            {
                d++;
                t=0;
            }
        }
    }
    if(t==0)
    {
        cout<<d+(f*4)/3+(j*4)/2;
    }
    else
    {
        cout<<ceil(j+t)+d+ceil(f);
    }

}


#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

int main()
{
    int y,x,d,f,j,t,sum=0;
    cin>>y;
    for(int i=0;i<y;i++)
    {
        cin>>x;
        sum+=x;
    }
    if(sum%4==0)
    {
        d=sum/4;
        cout<<d;
    }
    else if(sum%3==0)
    {
        f=sum/3;
        cout<<f;
    }
    else if(sum%2==03)
    {
        j=sum/2;
        cout<<j;
    }
    else
    {
        t=(sum+3)/4;
        cout<<t;
    }

}


#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

int main()
{
    int y,x,d=0,f=0,j=0,t=0,v,b,m=0;
    cin>>y;
    for(int i=0;i<y;i++)
    {
        cin>>x;
        if(x==4)
        {
            d++;
        }
        else if(x==3)
        {
            f++;

        }
        else if(x==2)
        {
            j++;

        }
        else if(x==1)
        {
            t++;
        }
    }
    if(f>=t)
    {
        cout<<d+f+(j+1)/2;
    }
    else
    {
        cout<<d+((j+1)/2)+((t-f)/4);
    }
}


#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

int main()
{
    double y,x,d=0,f=0,t=0,j=0;
    cin>>y;
    for(int i=0;i<y;i++)
    {
        cin>>x;
        if(x==4)
        {
            d++;
        }
        else if(x==3)
        {
            f+=0.75;
        }
        else if(x==2)
        {
            j+=0.5;
        }
        else if(x==1)
        {
            t+=0.25;
        }
        if(t>0&&f>0)
            {
                t-=0.25;
                f-=0.75;
                d++;
            }
    }
    cout<<d+(f*4)/3+ceil(t+j);
}


#include <iostream>
#include <vector>

using namespace std;

int main(){
    int polje[5]={0}, unos, n;
    cin>>n;
    for(int i=0;i<n;++i){
        cin>>unos;
        polje[unos]++;
    }
    //taksiji sa cetiri osobe
    int br_taksija=polje[4];

    //taksiji sa tri osobe i jedno mjesto koje ostaje
    int ostalo_jedno_mjesto=polje[3];
    br_taksija+=polje[3];

    //dodajem taksije za osobe sa dva putnika
    br_taksija+=((polje[2]/2)+(polje[2]%2));

    //znaci da su jos dva mjesta ostala u taksiju za dva
    if(polje[2]%2){
        polje[1]-=2;
    }

    //stavljam osobe sa jednim mjestom u taksije od tri i dodajem koliko treba
    //taksija za preostale osobe sa jednim mjestom

    if(polje[1]>0){
        if(polje[1]>ostalo_jedno_mjesto){
            polje[1]-=ostalo_jedno_mjesto;
            br_taksija+=(polje[1]/4 + polje[1]%4);
        }
    }

    cout<<br_taksija<<endl;

return 0;
}


#include <iostream>
#include <vector>

using namespace std;

int main()
{

    int n, rjesenje=0, unos;
    cin>>n;

    int jedan=0, dva=0, tri=0;

    for(int i=0;i<n;++i)
    {
        cin>>unos;
        if(unos==1)
            jedan++;
        else if(unos==2)
            dva++;
        else if(unos==3)
            tri++;
        else if(unos==4)
            rjesenje++;
    }

    //cout<<"jedan "<<jedan<<" dva "<<dva<<" tri "<<tri<<" rjesenje "<<rjesenje<<endl;
    rjesenje+=tri;
    jedan-=tri;
    tri=0;
    //cout<<"jedan "<<jedan<<" dva "<<dva<<" tri "<<tri<<" rjesenje "<<rjesenje<<endl;
    rjesenje+=(dva/2);
    dva=dva%2;

    //cout<<"jedan "<<jedan<<" dva "<<dva<<" tri "<<tri<<" rjesenje "<<rjesenje<<endl;
    int zadnjiAuto=0;
    if(dva)
        zadnjiAuto=2;

    if(jedan>0)
        zadnjiAuto+=1;

    if(zadnjiAuto>0)
        rjesenje+=(zadnjiAuto/4+1);

    //cout<<"jedan "<<jedan<<" dva "<<dva<<" tri "<<tri<<" rjesenje "<<rjesenje<<endl;
    cout<<rjesenje<<endl;

return 0;
}


#include <iostream>
#include <vector>

using namespace std;

int main()
{

    int n, rjesenje=0, unos;
    cin>>n;

    int jedan=0, dva=0, tri=0;

    for(int i=0;i<n;++i)
    {
        cin>>unos;
        if(unos==1)
            jedan++;
        else if(unos==2)
            dva++;
        else if(unos==3)
            tri++;
        else if(unos==4)
            rjesenje++;
    }

    //cout<<"jedan "<<jedan<<" dva "<<dva<<" tri "<<tri<<" rjesenje "<<rjesenje<<endl;
    rjesenje+=tri;
    jedan-=tri;
    tri=0;
    //cout<<"jedan "<<jedan<<" dva "<<dva<<" tri "<<tri<<" rjesenje "<<rjesenje<<endl;
    rjesenje+=(dva/2);
    dva=dva%2;

    //cout<<"jedan "<<jedan<<" dva "<<dva<<" tri "<<tri<<" rjesenje "<<rjesenje<<endl;
    int zadnjiAuto=0;
    if(dva)
        zadnjiAuto=2;

    if(jedan>0)
        zadnjiAuto+=jedan;

    if(zadnjiAuto>0)
    {
        if(zadnjiAuto%4)
            rjesenje+=(zadnjiAuto/4+1);
        else
            rjesenje+=(zadnjiAuto/4);
    }

    //cout<<"jedan "<<jedan<<" dva "<<dva<<" tri "<<tri<<" rjesenje "<<rjesenje<<endl;
    cout<<rjesenje<<endl;

return 0;
}


#include <iostream>
#include <vector>

using namespace std;

int main(){
    int polje[5]={0}, unos, n;
    cin>>n;
    for(int i=0;i<n;++i){
        cin>>unos;
        polje[unos]++;
    }
    //taksiji sa cetiri osobe
    int br_taksija=polje[4];

    //taksiji sa tri osobe i jedno mjesto koje ostaje
    int ostalo_jedno_mjesto=polje[3];
    br_taksija+=polje[3];

    //dodajem taksije za osobe sa dva putnika
    br_taksija+=((polje[2]/2)+(polje[2]%2));

    //znaci da su jos dva mjesta ostala u taksiju za dva
    if(polje[2]%2){
        polje[1]-=2;
    }

    //stavljam osobe sa jednim mjestom u taksije od tri i dodajem koliko treba
    //taksija za preostale osobe sa jednim mjestom

    if(polje[1]>0){
        if(polje[1]>ostalo_jedno_mjesto){
            polje[1]-=ostalo_jedno_mjesto;
            if(polje[1]%4)
                br_taksija++;
            br_taksija+=(polje[1]/4);
        }
    }

    cout<<br_taksija<<endl;

return 0;
}


#include <iostream>
#include <vector>

using namespace std;

int main()
{

    int n, rjesenje=0, unos;
    cin>>n;

    int jedan=0, dva=0, tri=0;

    for(int i=0;i<n;++i)
    {
        cin>>unos;
        if(unos==1)
            jedan++;
        else if(unos==2)
            dva++;
        else if(unos==3)
            tri++;
        else if(unos==4)
            rjesenje++;
    }

    //cout<<"jedan "<<jedan<<" dva "<<dva<<" tri "<<tri<<" rjesenje "<<rjesenje<<endl;
    rjesenje+=tri;
    jedan-=tri;
    tri=0;
    //cout<<"jedan "<<jedan<<" dva "<<dva<<" tri "<<tri<<" rjesenje "<<rjesenje<<endl;
    rjesenje+=(dva/2);
    dva=dva%2;

    //cout<<"jedan "<<jedan<<" dva "<<dva<<" tri "<<tri<<" rjesenje "<<rjesenje<<endl;
    int zadnjiAuto=0;
    if(dva)
        zadnjiAuto=2;

    if(jedan>0)
        zadnjiAuto+=jedan;

    if(zadnjiAuto>0)
        rjesenje+=(zadnjiAuto/4+1);

    //cout<<"jedan "<<jedan<<" dva "<<dva<<" tri "<<tri<<" rjesenje "<<rjesenje<<endl;
    cout<<rjesenje<<endl;

return 0;
}


#include <iostream>

using namespace std;

int main()
{

    int n ,counter=0 ;
    cin>>n;
   int groups[n] ;
    for (int s =0 ; s<n ; s++){
       cin>>groups[s] ;
       if(groups[s]==4)
        counter++;
   }
    for (int i =0 ; i<n ; i++){
            for(int j=i+1 ; j<n ; j++){
                if(groups[i]<groups[j])
                    swap(groups[i],groups[j]);
            }
   }
   for(int i=counter ; i<n ; i++){
       int  sum=groups[i];
     for(int j=i+1 ; j<n ; j++){
        if(sum+groups[j] <= 4){
            sum+=groups[j];
            groups[j]=50;
        }
    }
    if(groups[i] != 50)
        counter++;
   }
    cout<<counter<<endl;
}


#include <iostream>

using namespace std;

int main()
{

    int n ,counter=0 ;
    cin>>n;
   int groups[n] ;
    for (int s =0 ; s<n ; s++){
       cin>>groups[s] ;
       if(groups[s]==4)
        counter++;
   }
    for (int i =0 ; i<n ; i++){
            for(int j=i+1 ; j<n ; j++){
                if(groups[i]<groups[j])
                    swap(groups[i],groups[j]);
            }
   }
   for(int i=counter ; i<n ; i++){
       int  sum=groups[i];
       if(sum != 50 ){
        for(int j=i+1 ; j<n ; j++){
        if(sum+groups[j] <= 4){
            sum+=groups[j];
            groups[j]=50;
        }

        if(sum==4)
            break ;
      }
       }

    if(groups[i] != 50)
        counter++;
   }
    cout<<counter<<endl;
}


#include <iostream>
#include <conio.h>
#include <string>
#include <cmath>
#include <algorithm>

using namespace std;

long int s[100005];
long int arr[5];
int main()
{
    long int n;
    long int answer =0;

    cin >> n;

    for (int i = 0; i < n; i++)
    {
        cin>>s[i];
    }

    sort(s, s + n);

    for (int i = 0; i < n ; i++)
    {
        if (s[i] == 4)
            arr[4]++;
        else if (s[i] == 3)
            arr[3]++;
        else if (s[i] == 2)
            arr[2]++;
        else if (s[i] == 1)
            arr[1]++;
    }

    answer += arr[4];
    if (arr[3] - arr[1] > 0)
    {
        arr[3] = arr[3] - arr[1];
        answer += arr[1];
    }
    else{
        arr[1] = arr[1] - arr[3];
        answer += arr[3];
    }
    if (arr[2] % 2 == 0)
    {
        answer += arr[2]/2;
    }
    else{
        arr[2] = 1;
        answer += (arr[2] - 1)/2;
        if ((arr[2] - 1) / 2 == 0)
            answer++;
    }
    if (arr[1] != 0 && arr[2] != 0)
    {
        if (arr[1] > arr[2])
            answer += arr[1];
        else{
            answer += arr[2];
        }
    }

    cout << answer;
    cin.get();
    cin.get();
    return 0;
}


#include <iostream>
#include <conio.h>
#include <string>
#include <cmath>
#include <algorithm>

using namespace std;
long int n;
long int s[5];
long int answer = 0;

int main()
{

    int x;
    cin >> n;

    for (int i = 0; i < n; i++)
    {
        cin >> x;
        s[x] ++;
    }

    answer += s[4];

    answer += s[3];

    if (s[1] > s[3])
    {
        s[1] = s[1] - s[3];
    }
    else{
        s[1] = 0;
    }
    answer += s[2] / 2;
    if (s[2] % 2 == 1)
    {
        answer++;
        if (s[1] <= 2)
        {

            s[1] = 0;
        }
        else{
            s[1] -= 2;
        }
    }
    answer+=s[1] / 4;
    if (s[1] % 4)
    {
        answer++;
    }
    cout << answer;
}


#include <iostream>
#include <conio.h>
#include <string>
#include <cmath>
#include <algorithm>

using namespace std;

long int s[100005];
long int arr[5];
int main()
{
    long int n;
    long int answer =0;
    long int res = 0;
    cin >> n;

    for (int i = 0; i < n; i++)
    {
        cin>>s[i];
    }

    sort(s, s + n);

    for (int i = 0; i < n; i++)
    {
        if (s[i] == 1)
        {
            arr[1]++;
        }
        if (s[i] == 2)
        {
            arr[2]++;
        }
        if (s[i] == 3)
        {
            arr[3]++;
        }
        if (s[i] == 4)
        {
            arr[4]++;
        }
    }

    answer += arr[4];
    if (arr[3] > arr[1])
    {
        answer += arr[1];
        answer += arr[3] - arr[1];
    }
    else{
        answer += arr[3];
        answer += arr[1] - arr[3];
    }
    if (arr[2] % 2 == 0)
    {
        answer += arr[2] / 2;
    }
    else{
        answer += (arr[2] - 1) / 2;
        answer++;
    }
    cout << answer;
    cin.get();
    cin.get();
    return 0;
}


#include <iostream>
#include <conio.h>
#include <string>
#include <cmath>
#include <algorithm>

using namespace std;

long int s[100005];
long int arr[5];
int main()
{
    long int n;
    long int answer =0;

    cin >> n;

    for (int i = 0; i < n; i++)
    {
        cin>>s[i];
    }

    sort(s, s + n);

    for (int i = 0; i < n ; i++)
    {
        if (s[i] == 4)
            arr[4]++;
        else if (s[i] == 3)
            arr[3]++;
        else if (s[i] == 2)
            arr[2]++;
        else if (s[i] == 1)
            arr[1]++;
    }

    answer += arr[4];
    arr[4] = 0;
    if (arr[3] - arr[1] > 0)
    {
        arr[3] = arr[3] - arr[1];
        answer += arr[1];
        arr[1] = 0;
    }
    else{
        arr[1] = arr[1] - arr[3];
        answer += arr[3];
        arr[3] = 0;
    }
    if (arr[2] % 2 == 0)
    {
        answer += arr[2]/2;
        arr[2] = 0;
    }
    else{
        answer += (arr[2] - 1)/2;
        if ((arr[2] - 1) / 2 == 0)
            answer++;
        arr[2] = 0;
    }
    if (arr[1] != 0 || arr[2] != 0)
    {
        if (arr[1] > arr[2])
            answer += arr[1];
        else{
            answer += arr[2];
        }
    }
    if (arr[3] != 0)
    {
        answer++;
        arr[3] = 0;
    }
    cout << answer;
    cin.get();
    cin.get();
    return 0;
}


#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <set>
#include <string>
#include <utility>
#include <vector>

using namespace std;

#define INF 2147483647
#define MOD 1000000007
#define MAX 100000

typedef long long ll;
typedef pair<int, int> pii;

int n, totals[4] = {};

int ceil(int num, int div)
{
    if (num % div == 0) {
        return num / div;
    } else {
        return num / div + 1;
    }
}

int main()
{
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
#endif // LOCAL

    cin >> n;
    for (int i = 0; i < n; i++) {
        int s;
        cin >> s;
        totals[s - 1]++;
    }

    for (int i = 0; i < 4; i++) {
        cout << totals[i] << " ";
    }
    cout << endl;

    int ret = totals[3] + totals[2];
    if (totals[0] <= totals[2]) {
        ret += ceil(totals[1], 2);
    } else {
        // totals[0] > totals[2]
        totals[0] -= totals[2];

        if (totals[1] & 1) {
            ret += ceil(totals[1], 2);
            ret += min(0, ceil(totals[0] - 2, 4));
        } else {
            ret += totals[1] / 2;
            ret += ceil(totals[0], 4);
        }
    }
    cout << ret << endl;
    return 0;
}


#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <set>
#include <string>
#include <utility>
#include <vector>

using namespace std;

#define INF 2147483647
#define MOD 1000000007
#define MAX 100000

typedef long long ll;
typedef pair<int, int> pii;

int n, totals[4] = {};

int ceil(int num, int div)
{
    if (num % div == 0) {
        return num / div;
    } else {
        return num / div + 1;
    }
}

int main()
{
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
#endif // LOCAL

    cin >> n;
    for (int i = 0; i < n; i++) {
        int s;
        cin >> s;
        totals[s - 1]++;
    }

//    for (int i = 0; i < 4; i++) {
//        cout << totals[i] << " ";
//    }
//    cout << endl;

    int ret = totals[3] + totals[2];
    if (totals[0] <= totals[2]) {
        ret += ceil(totals[1], 2);
    } else {
        // totals[0] > totals[2]
        totals[0] -= totals[2];

        if (totals[1] & 1) {
            ret += ceil(totals[1], 2);
            ret += min(0, ceil(totals[0] - 2, 4));
        } else {
            ret += totals[1] / 2;
            ret += ceil(totals[0], 4);
        }
    }
    cout << ret << endl;
    return 0;
}


#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <set>
#include <string>
#include <utility>
#include <vector>

using namespace std;

#define INF 2147483647
#define MOD 1000000007
#define MAX 100000

typedef long long ll;
typedef pair<int, int> pii;

int n, totals[4];

int ceil(int num, int div)
{
    if (num % div == 0) {
        return num / div;
    } else {
        return num / div + 1;
    }
}

int main()
{
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
#endif // LOCAL

    cin >> n;
    for (int i = 0; i < n; i++) {
        int s;
        cin >> s;
        totals[s - 1]++;
    }

    int ret = totals[3] + totals[2];
    if (totals[0] <= totals[2]) {
        ret += ceil(totals[1], 2);
    } else {
        // totals[0] > totals[2]
        totals[0] -= totals[2];

        if (totals[1] & 1) {
            ret += totals[1] / 2;
            ret += min(0, ceil(totals[0] - 2, 4));
        } else {
            ret += totals[1] / 2;
            ret += ceil(totals[0], 4);
        }
    }
    cout << ret << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

const int maxn=1e5+10;

int n,x,y,res;
long long mang[maxn];

bool test (int a)
{
	for (int i=1; i<=x; i++)
	{
		if (a<=i) break;
		if (mang[a]>mang[a-i]) return false;
	}
	for (int i=1; i<=y; i++)
	{
		if (a+i>=n+1) break;
		if (mang[a]>mang[a+i]) return false;
	}

	return true;
}
int main ()
{
	//freopen ("1.inp", "r", stdin) ;
	//freopen ("007.out", "w", stdout);
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    cin >> n >> x >>y;

    for (int i=1; i<=n; i++)
    cin >> mang[i];
    for (int i=x+1; i<=n; i++)
    {
    	if (test (i)==true)
		{
			res=i;
			break;
		}
	}
	if(res!=0)
	cout << res;
	else cout << n;

}


#include <bits/stdc++.h>

//PROBLEM: https://codeforces.com/contest/1199/problem/A

using namespace std;

bool if_greater(vector<int> &arr, int begin_idx, int end_idx, int check_idx, int size) {
    //Take care if ranges exceed left or right limits
    end_idx = end_idx > size ? size : end_idx;
    begin_idx = begin_idx < 0 ? 0 : begin_idx;
    for (int i = begin_idx; i < end_idx; i++) {
        if (arr[i] < arr[check_idx])
            return false;
    }
    return true;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n, x, y;
    cin >> n >> x >> y;
    vector<int> arr(n);
    for (int i = 0; i < n; i++) scanf("%d", &arr[i]);
    for (int i = 0; i < n; i++) {
        bool first_seg = if_greater(arr, i - x, i - 1, i, n);// Check from i - x to i - 1
        bool second_seg = if_greater(arr, i + 1, i + 1 + y, i, n);// Check from i + 1 to i + 1  + y
        if (first_seg && second_seg) {
            printf("%d", i + 1);
            return 0;
        }
    }
    return 0;
}


#include <bits/stdc++.h>

//PROBLEM: https://codeforces.com/contest/1199/problem/A

using namespace std;

bool if_greater(vector<int> &arr, int begin_idx, int end_idx, int check_idx, int size) {
    //Take care if ranges exceed left or right limits
    end_idx = end_idx > size ? size : end_idx;
    begin_idx = begin_idx < 0 ? 0 : begin_idx;
    for (int i = begin_idx; i < end_idx; i++) {
        if (arr[i] < arr[check_idx])
            return false;
    }
    return true;
}

int main() {
    int n, x, y;
    cin >> n >> x >> y;
    vector<int> arr(n);
    for (int i = 0; i < n; i++) scanf("%d", &arr[i]);
    for (int i = 0; i < n; i++) {
        bool first_seg = if_greater(arr, i - x, i - 1, i, n);// Check from i - x to i - 1
        bool second_seg = if_greater(arr, i + 1, i + 1 + y, i, n);// Check from i + 1 to i + 1  + y
        if (first_seg && second_seg) {
            printf("%d", i + 1);
            return 0;
        }
    }
    return 0;
}


#include <bits/stdc++.h>

//PROBLEM: https://codeforces.com/contest/1199/problem/A

using namespace std;

bool if_greater(vector<int> &arr, int begin_idx, int end_idx, int check_idx, int size) {
    //Take care if ranges exceed left or right limits
    end_idx = end_idx > size ? size : end_idx;
    begin_idx = begin_idx < 0 ? 0 : begin_idx;
    for (int i = begin_idx; i < end_idx; i++) {
        if (arr[i] < arr[check_idx])
            return false;
    }
    return true;
}

int main() {
    int n, x, y;
    cin >> n >> x >> y;
    vector<int> arr(n);
    for (int i = 0; i < n; i++) cin >> arr[i];
    for (int i = 0; i < n; i++) {
        bool first_seg = if_greater(arr, i - x, i - 1, i, n);// Check from i - x to i - 1
        bool second_seg = if_greater(arr, i + 1, i + 1 + y, i, n);// Check from i + 1 to i + 1  + y
        if (first_seg && second_seg) {
            cout << i + 1;
            return 0;
        }
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

//ERROR , fix it: https://codeforces.com/contest/1199/problem/A
bool if_greater(int arr[], int begin_idx, int end_idx, int check_idx, int size) {
    end_idx = end_idx > size?size:end_idx;
    begin_idx = begin_idx < 0? 0: begin_idx;
    for (int i = begin_idx; i < end_idx; i++) {
        if (arr[i] < arr[check_idx])
            return false;
    }
    return true;
}

int main() {
    int n, x, y;
    cin >> n >> x >> y;
    int arr[1000005];
    for (int i = 0; i < n; i++) {
        cin >> arr[i];
    }

//    if ((x == n) && if_greater(arr, 0, x, n - 1, n)) {
//        cout << n;
//        return 0;
//    }

    for (int i = 0; i < n; i++) {
        bool first_seg = false;
        bool second_seg = false;
        //if(i >= x - 1)
             first_seg = if_greater(arr, i - x, i - 1, i, n);
        //else if(x == 0)
        //    first_seg = true;
        //if(i + 1 + y < n)
            second_seg = if_greater(arr, i + 1, i + 1 + y, i, n);
        //else if(y == 0)
        //    second_seg = true;
        if (first_seg && second_seg) {
            cout << i + 1;
            return 0;
        }
    }
    return 0;
}


#include <bits/stdc++.h>

//PROBLEM: https://codeforces.com/contest/1199/problem/A

using namespace std;

bool if_greater(vector<int> &arr, int begin_idx, int end_idx, int check_idx, int size) {
    //Take care if ranges exceed left or right limits
    end_idx = end_idx > size ? size : end_idx;
    begin_idx = begin_idx < 0 ? 0 : begin_idx;
    for (int i = begin_idx; i < end_idx; i++) {
        if (arr[i] < arr[check_idx])
            return false;
    }
    return true;
}

int main() {
    int n, x, y;
    scanf("%d %d %d", &n, &x, &y);
    vector<int> arr(n);
    for (int i = 0; i < n; i++) scanf("%d", &arr[i]);
    for (int i = 0; i < n; i++) {
        bool first_seg = if_greater(arr, i - x, i - 1, i, n);// Check from i - x to i - 1
        bool second_seg = if_greater(arr, i + 1, i + 1 + y, i, n);// Check from i + 1 to i + 1  + y
        if (first_seg && second_seg) {
            printf("%d", i + 1);
            return 0;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

bool if_greater(int arr[], int begin_idx, int length, int check_idx, int size){
    int last_idx = begin_idx+length <size? begin_idx+length:size;
    for(int  i = begin_idx; i < last_idx; i++){
        if(arr[i] < arr[check_idx])
            return false;
    }
    return true;
}
int main(){
    int n, x, y;
    cin>>n>>x>>y;
    int arr[1000005];
    for(int  i = 0 ; i < n ; i++){
        cin>>arr[i];
    }

    if(x==n && if_greater(arr, 0, x,n-1,n)){
        cout<< n;
        return 0;
    }

    int start_idx = x;
    int init_idx = 0;
    for(int  i = start_idx ; i <n; i++ ){
        bool first_seg = if_greater(arr, init_idx, x, i, n);
        bool second_seg = if_greater(arr, i + 1, y, i, n);
        if(first_seg && second_seg){
            cout<< i + 1;
            return 0;
        }
        init_idx++;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define int long long int
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define lb lower_bound
#define ub upper_bound
#define srt(a) sort(a.begin(),a.end())
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
#define mxe(a) *max_element(a.begin(),a.end())
#define mne(a) *min_element(a.begin(),a.end())
#define endl '\n'
#define INF 1000000007
#define mod 998244353
#define INF64 1e18

/*template<int D, typename T>
struct Vec : public vector<Vec<D - 1, T>> {
  static_assert(D >= 1, "Vector dimension must be greater than zero!");
  template<typename... Args>
  Vec(int n = 0, Args... args) : vector<Vec<D - 1, T>>(n, Vec<D - 1, T>(args...)) {
  }
};
template<typename T>
struct Vec<1, T> : public vector<T> {
  Vec(int n = 0, const T& val = T()) : vector<T>(n, val) {
  }
};*/
/*ll power(ll a,ll b){
  ll res=1;
  while(b>0){
    if(b&1)(res*=a)%=mod;
    (a*=a)%=mod;
    b>>=1;
  }
  return res;
}*/

void solve(){
  int n,x,y;cin>>n>>x>>y;
  vi a(n);
  for(int i=0;i<n;i++)
    cin>>a[i];

  int i;
  for(i=x;i<n-y;i++){
    bool f=1;
    for(int j=1;j<=x;j++)
      if(a[i]>=a[i-j]){f=0;break;}
    if(f){
      for(int j=1;j<=y;j++)
        if(a[i]>=a[i+j]){f=0;break;}
    }
    if(!f)
      continue;
    else break;
  }
  if(i==n){
    bool f=1;
    for(int i=1;i<=y;i++)
      if(a[0]>=a[i]){f=0;break;}

      cout<<f?1:n;
  }
  else cout<<i+1;

}

int32_t main(){
  #ifndef ONLINE_JUDGE
   freopen("input.txt","r",stdin);
   freopen("output.txt","w",stdout);
  #endif

  ios_base::sync_with_stdio(false);
  cin.tie(0);cout.tie(0);

  int T;
  //cin>>T;
  T=1;
  while(T--){
    solve();
  }
}


#include<bits/stdc++.h>
using namespace std;

#define int long long int
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define lb lower_bound
#define ub upper_bound
#define srt(a) sort(a.begin(),a.end())
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
#define mxe(a) *max_element(a.begin(),a.end())
#define mne(a) *min_element(a.begin(),a.end())
#define endl '\n'
#define INF 1000000007
#define mod 998244353
#define INF64 1e18

/*template<int D, typename T>
struct Vec : public vector<Vec<D - 1, T>> {
  static_assert(D >= 1, "Vector dimension must be greater than zero!");
  template<typename... Args>
  Vec(int n = 0, Args... args) : vector<Vec<D - 1, T>>(n, Vec<D - 1, T>(args...)) {
  }
};
template<typename T>
struct Vec<1, T> : public vector<T> {
  Vec(int n = 0, const T& val = T()) : vector<T>(n, val) {
  }
};*/
/*ll power(ll a,ll b){
  ll res=1;
  while(b>0){
    if(b&1)(res*=a)%=mod;
    (a*=a)%=mod;
    b>>=1;
  }
  return res;
}*/

void solve(){
  int n,x,y;cin>>n>>x>>y;
  vi a(n);
  for(int i=0;i<n;i++)
    cin>>a[i];
  int j=0;
  for(int i=0;i<n;i++){
    if(a[i]<a[j])
      j=i;
    if(i-j>=y)break;
  }
 cout<<j+1;
}

int32_t main(){
  #ifndef ONLINE_JUDGE
   freopen("input.txt","r",stdin);
   freopen("output.txt","w",stdout);
  #endif

  ios_base::sync_with_stdio(false);
  cin.tie(0);cout.tie(0);

  int T;
  //cin>>T;
  T=1;
  while(T--){
    solve();
  }
}


#include<bits/stdc++.h>
using namespace std;

#define int long long int
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define lb lower_bound
#define ub upper_bound
#define srt(a) sort(a.begin(),a.end())
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
#define mxe(a) *max_element(a.begin(),a.end())
#define mne(a) *min_element(a.begin(),a.end())
#define endl '\n'
#define INF 1000000007
#define mod 998244353
#define INF64 1e18

/*template<int D, typename T>
struct Vec : public vector<Vec<D - 1, T>> {
  static_assert(D >= 1, "Vector dimension must be greater than zero!");
  template<typename... Args>
  Vec(int n = 0, Args... args) : vector<Vec<D - 1, T>>(n, Vec<D - 1, T>(args...)) {
  }
};
template<typename T>
struct Vec<1, T> : public vector<T> {
  Vec(int n = 0, const T& val = T()) : vector<T>(n, val) {
  }
};*/
/*ll power(ll a,ll b){
  ll res=1;
  while(b>0){
    if(b&1)(res*=a)%=mod;
    (a*=a)%=mod;
    b>>=1;
  }
  return res;
}*/

void solve(){
  int n,x,y;cin>>n>>x>>y;
  vi a(n);
  for(int i=0;i<n;i++)
    cin>>a[i];
  int j=0;
  for(int i=1;i<n;i++){
    if(a[i]<a[j])
      j=i;
    if(i-j>=y)break;
  }
 cout<<j+1;
}

int32_t main(){
  #ifndef ONLINE_JUDGE
   freopen("input.txt","r",stdin);
   freopen("output.txt","w",stdout);
  #endif

  ios_base::sync_with_stdio(false);
  cin.tie(0);cout.tie(0);

  int T;
  //cin>>T;
  T=1;
  while(T--){
    solve();
  }
}


#include<bits/stdc++.h>
using namespace std;

#define int long long int
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define lb lower_bound
#define ub upper_bound
#define srt(a) sort(a.begin(),a.end())
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
#define mxe(a) *max_element(a.begin(),a.end())
#define mne(a) *min_element(a.begin(),a.end())
#define endl '\n'
#define INF 1000000007
#define mod 998244353
#define INF64 1e18

/*template<int D, typename T>
struct Vec : public vector<Vec<D - 1, T>> {
  static_assert(D >= 1, "Vector dimension must be greater than zero!");
  template<typename... Args>
  Vec(int n = 0, Args... args) : vector<Vec<D - 1, T>>(n, Vec<D - 1, T>(args...)) {
  }
};
template<typename T>
struct Vec<1, T> : public vector<T> {
  Vec(int n = 0, const T& val = T()) : vector<T>(n, val) {
  }
};*/
/*ll power(ll a,ll b){
  ll res=1;
  while(b>0){
    if(b&1)(res*=a)%=mod;
    (a*=a)%=mod;
    b>>=1;
  }
  return res;
}*/

void solve(){
  int n,x,y;cin>>n>>x>>y;
  vi a(n);
  for(int i=0;i<n;i++)
    cin>>a[i];

  int i;
  for(i=x;i<n-y;i++){
    bool f=1;
    for(int j=1;j<=x;j++)
      if(a[i]>=a[i-j]){f=0;break;}
    if(f){
      for(int j=1;j<=y;j++)
        if(a[i]>=a[i+j]){f=0;break;}
    }
    if(!f)
      continue;
    else break;
  }
  cout<<(i==n?n:i+1);
}

int32_t main(){
  #ifndef ONLINE_JUDGE
   freopen("input.txt","r",stdin);
   freopen("output.txt","w",stdout);
  #endif

  ios_base::sync_with_stdio(false);
  cin.tie(0);cout.tie(0);

  int T;
  //cin>>T;
  T=1;
  while(T--){
    solve();
  }
}


#include<bits/stdc++.h>
using namespace std;

#define int long long int
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define lb lower_bound
#define ub upper_bound
#define srt(a) sort(a.begin(),a.end())
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
#define mxe(a) *max_element(a.begin(),a.end())
#define mne(a) *min_element(a.begin(),a.end())
#define endl '\n'
#define INF 1000000007
#define mod 998244353
#define INF64 1e18

/*template<int D, typename T>
struct Vec : public vector<Vec<D - 1, T>> {
  static_assert(D >= 1, "Vector dimension must be greater than zero!");
  template<typename... Args>
  Vec(int n = 0, Args... args) : vector<Vec<D - 1, T>>(n, Vec<D - 1, T>(args...)) {
  }
};
template<typename T>
struct Vec<1, T> : public vector<T> {
  Vec(int n = 0, const T& val = T()) : vector<T>(n, val) {
  }
};*/
/*ll power(ll a,ll b){
  ll res=1;
  while(b>0){
    if(b&1)(res*=a)%=mod;
    (a*=a)%=mod;
    b>>=1;
  }
  return res;
}*/

void solve(){
  int n,x,y;cin>>n>>x>>y;
  vi a(n);
  for(int i=0;i<n;i++)
    cin>>a[i];

  int i;
  for(i=x;i<n-y;i++){
    bool f=1;
    for(int j=1;j<=x;j++)
      if(a[i]>=a[i-j]){f=0;break;}
    if(f){
      for(int j=1;j<=y;j++)
        if(a[i]>=a[i+j]){f=0;break;}
    }
    if(!f)
      continue;
    else break;
  }
  cout<<i+1;
}

int32_t main(){
  #ifndef ONLINE_JUDGE
   freopen("input.txt","r",stdin);
   freopen("output.txt","w",stdout);
  #endif

  ios_base::sync_with_stdio(false);
  cin.tie(0);cout.tie(0);

  int T;
  //cin>>T;
  T=1;
  while(T--){
    solve();
  }
}


#include <bits/stdc++.h>
#define pb push_back
using namespace std;

int main() {
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    long long int n, i, j, k, l, m, a = 0, b = -1, c, sum = 0, x = 0, y = 0;
    cin >> n >> x >> y;
    long long arr[n];
    for(i = 0; i < n; i++){
        cin >> arr[i];
    }
    for(i = 0; i < n; i++){
        for(j = i - x; j <= i+y; j++){
            if(j < 0)
            j = 0;
            if(j == i)
            j++;
            if(j > n-1)
            break;
            if(arr[j] < arr[i]){
                b = -1;
                break;
            }
        }
        if(b == 0){
            cout << i+1;
            return 0;
        }
        b = 0;
    }

	return 0;
}


    #include <bits/stdc++.h>
    #define pb push_back
    using namespace std;

    int main() {
    	ios_base::sync_with_stdio(false);
        cin.tie(NULL);
        cout.tie(NULL);
        long long int n, i, j, k, l, m, a = 0, b = -1, c, sum = 0, x = 0, y = 0;
        cin >> n >> x >> y;
        long long arr[n];
        for(i = 0; i < n; i++){
            cin >> arr[i];
        }
        if(n == 1){
            cout << "1";
            return 0;
        }

        for(i = 0; i < n; i++){
                b = -1;
            for(j = i - x; j <= min(i+y,n-1); j++){
                if(j < 0)
                j = 0;
                if(j == i){
                    continue;
                }
                if(arr[j] <= arr[i]){
                    b = 0;
                    break;
                }
            }
            if(b == -1){
                cout << i+1;
                return 0;
            }
        }

    	return 0;
    }


#include <bits/stdc++.h>
#define pb push_back
using namespace std;

int main() {
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    long long int n, i, j, k, l, m, a = 0, b = 0, c, sum = 0, x = 0, y = 0;
    cin >> n >> x >> y;
    long long arr[n];
    for(i = 0; i < n; i++){
        cin >> arr[i];
    }
    for(i = 0; i < n; i++){
        for(j = i - x; j <= i+y; j++){
            if(j < 0)
            j = 0;
            if(j > n-1)
            break;
            if(j == i)
            j++;
            if(arr[j] < arr[i]){
                b = -1;
                break;
            }
        }
        if(b == 0){
            cout << i+1;
            return 0;
        }
        b = 0;
    }

	return 0;
}


    #include <bits/stdc++.h>
    #define pb push_back
    using namespace std;

    int main() {
    	ios_base::sync_with_stdio(false);
        cin.tie(NULL);
        cout.tie(NULL);
        long long int n, i, j, k, l, m, a = 0, b = -1, c, sum = 0, x = 0, y = 0;
        cin >> n >> x >> y;
        long long arr[n];
        for(i = 0; i < n; i++){
            cin >> arr[i];
        }
        if(n == 1){
            cout << "1";
            return 0;
        }

        for(i = 0; i < n; i++){
            for(j = i - x; j <= i+y; j++){
                if(j < 0)
                j = 0;
                if(j == i)
                j++;
                if(j > n-1){
                    if(y == 0)
                    b =0;
                    break;
                }
               // break;
                if(arr[j] < arr[i]){
                    b = -1;
                    break;
                }
            }
            if(b == 0){
                cout << i+1;
                return 0;
            }
            b = 0;
        }

    	return 0;
    }


    #include <bits/stdc++.h>
    #define pb push_back
    using namespace std;

    int main() {
    	ios_base::sync_with_stdio(false);
        cin.tie(NULL);
        cout.tie(NULL);
        long long int n, i, j, k, l, m, a = 0, b = -1, c, sum = 0, x = 0, y = 0;
        cin >> n >> x >> y;
        long long arr[n];
        for(i = 0; i < n; i++){
            cin >> arr[i];
        }
        for(i = 0; i < n; i++){
            for(j = i - x; j <= i+y; j++){
                if(j < 0)
                j = 0;
                if(j == i)
                j++;
                if(j > n-1)
                break;
                if(arr[j] <= arr[i]){
                    b = -1;
                    break;
                }
            }
            if(b == 0){
                cout << i+1;
                return 0;
            }
            b = 0;
        }

    	return 0;
    }


    #include <bits/stdc++.h>
    #define pb push_back
    using namespace std;

    int main() {
    	ios_base::sync_with_stdio(false);
        cin.tie(NULL);
        cout.tie(NULL);
        long long int n, i, j, k, l, m, a = 0, b = -1, c, sum = 0, x = 0, y = 0;
        cin >> n >> x >> y;
        long long arr[n];
        for(i = 0; i < n; i++){
            cin >> arr[i];
        }
        if(n == 1){
            cout << "1";
            return 0;
        }

        for(i = 0; i < n; i++){
            for(j = i - x; j <= i+y; j++){
                if(j < 0)
                j = 0;
                if(j == i)
                j++;
                if(j > n-1)
                break;
                if(arr[j] < arr[i]){
                    b = -1;
                    break;
                }
            }
            if(b == 0){
                cout << i+1;
                return 0;
            }
            b = 0;
        }

    	return 0;
    }


#include <bits/stdc++.h>
#define pb push_back
using namespace std;

int main() {
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    long long int n, i, j, k, l, m, a = 0, b = 0, c, sum = 0, x = 0, y = 0;
    cin >> n >> x >> y;
    long long arr[n];
    for(i = 0; i < n; i++){
        cin >> arr[i];
    }
    for(i = 0; i < n; i++){
        for(j = i - x; j <= i+y; j++){
            if(j < 0)
            j = 0;
            if(j == i)
            j++;
            if(j > n-1)
            break;
            if(arr[j] < arr[i]){
                b = -1;
                break;
            }
        }
        if(b == 0){
            cout << i+1;
            return 0;
        }
        b = 0;
    }

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int tab[100019];
int main()
{
	int n, x,y;
	scanf("%d%d%d", &n,&x,&y);
	for(int i=1;i<=n;i++)
	scanf("%d", &tab[i]);
	for(int i=1;i<=n;i++)
	{
		int f=1;
	for(int j=i-1;j>=max(1,j-x); j--)
{
		if(tab[j]<=tab[i])
	f=0;
}
	for(int j=i+1;j<=min(n,i+y); j++)
{
		if(tab[j]<=tab[i])
	f=0;
}
	if(f==1)
	{
		printf("%d", i);
		return 0;
	}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int tab[100028];
int main()
{
	int n, x,y;
	scanf("%d%d%d", &n,&x,&y);
	for(int i=1;i<=7;i++)
	tab[i]=1e9+7;
	for(int i=n+1;i<=n+7;i++)
	tab[i]=1e9+7;
	for(int i=8;i<=n+7;i++)
	scanf("%d", &tab[i]);
	for(int i=8;i<=n+7;i++)
	{
		int f=1;
	for(int j=i-1;j>=j-x; j--)
{
		if(tab[j]<=tab[i])
	{
	f=0;
	break;
}
}
	if(f!=0)
	for(int j=i+1;j<=i+y; j++)
{
		if(tab[j]<=tab[i])
{
		f=0;
	break;
	}
}
	if(f==1)
	{
		printf("%d", i);
		return 0;
	}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int tab[100019];
int main()
{
	int n, x,y;
	scanf("%d%d%d", &n,&x,&y);
	for(int i=1;i<=n;i++)
	scanf("%d", &tab[i]);
	for(int i=1;i<=n;i++)
	{
		int f=1;
	for(int j=i-1;j>=max(1,j-x); j--)
{
		if(tab[j]<=tab[i])
	{
	f=0;
	break;
}
}
	if(f!=0)
	for(int j=i+1;j<=min(n,i+y); j++)
{
		if(tab[j]<=tab[i])
{
		f=0;
	break;
	}
}
	if(f==1)
	{
		printf("%d", i);
		return 0;
	}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int tab[100019];
int main()
{
	int n, x,y;
	scanf("%d%d%d", &n,&x,&y);
	for(int i=1;i<=n;i++)
	scanf("%d", &tab[i]);
	for(int i=1;i<=n;i++)
	{
		int f=1;
	for(int j=i-1;j>=max(0,j-x); j--)
	if(tab[j]<=tab[i])
	f=0;
	for(int j=i+1;j<=min(n,j+y); j++)
	if(tab[j]<=tab[i])
	f=0;
	if(f==1)
	{
		printf("%d", i);
		return 0;
	}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int tab[100028];
int main()
{
	int n, x,y;
	scanf("%d%d%d", &n,&x,&y);
	for(int i=1;i<=7;i++)
	tab[i]=1e9+7;
	for(int i=n+8;i<=n+14;i++)
	tab[i]=1e9+7;
	for(int i=8;i<=n+7;i++)
	scanf("%d", &tab[i]);
	for(int i=8;i<=n+7;i++)
	{

		int f=1;
	for(int j=i-1;j>=i-x; j--)
{
		if(tab[j]<=tab[i])
	{
	f=0;
	break;
}
}
	if(f!=0)
	for(int j=i+1;j<=i+y; j++)
{
		if(tab[j]<=tab[i])
{
		f=0;
	break;
	}
}
	if(f==1)
	{
		printf("%d", i-7);
		return 0;
	}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int tab[100028];
int main()
{
	int n, x,y;
	scanf("%d%d%d", &n,&x,&y);
	for(int i=1;i<=7;i++)
	tab[i]=1e9+7;
	for(int i=n+1;i<=n+7;i++)
	tab[i]=1e9+7;
	for(int i=8;i<=n+7;i++)
	scanf("%d", &tab[i]);
	for(int i=8;i<=n+7;i++)
	{
		int f=1;
	for(int j=i-1;j>=j-x; j--)
{
		if(tab[j]<=tab[i])
	{
	f=0;
	break;
}
}
	if(f!=0)
	for(int j=i+1;j<=i+y; j++)
{
		if(tab[j]<=tab[i])
{
		f=0;
	break;
	}
}
	if(f==1)
	{
		printf("%d", i-7);
		return 0;
	}
	}
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int i,j=1,k,l,n,m,x,y, flag=1, before=0, after=0;

    cin >> n >> x >> y;;

    int arr[n];

    for(i=0; i<n; i++)
        scanf("%d", &arr[i]);

    for(i=1; i<n; i++)
    {
        if(arr[i-1]>arr[i])
        {
            if(after)
                flag=0;
            after=0;
            before++;
            if(before>=x)
            {
                j=i+1;
                flag=1;
            }
        }
        else if(arr[i-1]<arr[i])
        {
            before=0;
            after++;
            if(flag==1 && after>=y)
            {
                cout << j << endl;
                return 0;
            }
        }
    }

    cout << j << endl;

    return 0;
}

/*
3 1 1
2 3 1
*/


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int i,j,k,l,n,m,x,y, flag=1, before=0, after=0;

    cin >> n >> x >> y;;

    int arr[n];

    for(i=0; i<n; i++)
        scanf("%d", &arr[i]);

    for(i=1; i<n; i++)
    {
        //cout << " " << i <<endl;
        if(arr[i-1]>arr[i])
        {
            if(before==x)
                flag=1;
            if(flag==1 && after==y)
            {
                cout << i+1 << endl;
                return 0;
            }
            after++;
            before=0;
        }
        else
        {
            if(flag==1 && after==y)
            {
                cout << i << endl;
                return 0;
            }
            if(before==x)
                flag=1;
            flag=0;
            after=0;
            before++;
        }
    }

    if(flag==1)
    {
        cout << i << endl;
        return 0;
    }
        //cout << 1 << endl;

    return 0;
}


///DNF

#include<bits/stdc++.h>

using namespace std;

int main()
{
    int i,j=1,k,l,n,m,x,y, flag=1, before=0, after=0;

    cin >> n >> x >> y;

    int arr[n];

    for(i=0; i<n; i++)
        scanf("%d", &arr[i]);

    if(y==0)
    {
        cout << 1 << endl;
        return 0;
    }

    for(i=1; i<n; i++)
    {
        if(arr[i-1]>arr[i])
        {
            if(after)
                flag=0;
            after=0;
            before++;
            j=i+1;
            if(before>=x)
                flag=1;
        }
        else if(arr[i-1]<arr[i])
        {
            before=0;
            after++;
            if(flag==1 && after>=y)
            {
                cout << j << endl;
                return 0;
            }
        }
    }

    cout << j << endl;

    return 0;
}

/*
3 1 1
2 3 1
*/


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int i,j=1,k,l,n,m,x,y, flag=1, before=0, after=0;

    cin >> n >> x >> y;;

    int arr[n];

    for(i=0; i<n; i++)
        scanf("%d", &arr[i]);

    for(i=1; i<n; i++)
    {
        if(arr[i-1]>arr[i])
        {
            if(after)
                flag=0;
            after=0;
            before++;
            j=i+1;
            if(before>=x)
                flag=1;
        }
        else if(arr[i-1]<arr[i])
        {
            before=0;
            after++;
            if(flag==1 && after>=y)
            {
                cout << j << endl;
                return 0;
            }
        }
    }

    cout << j << endl;

    return 0;
}

/*
3 1 1
2 3 1
*/


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int i,j=1,k,l,n,m,x,y, flag=1, before=0, after=0;

    cin >> n >> x >> y;;

    int arr[n];

    for(i=0; i<n; i++)
        scanf("%d", &arr[i]);

    for(i=1; i<n; i++)
    {
        //cout << " " << i <<endl;
        if(arr[i-1]>arr[i])
        {
            after=0;
            before++;
            j=i+1;
        }
        else
        {
            if(before>=x)
                flag=1;
            else
            {
                flag=0;
                before=0;
            }
            after++;
        }
        if(flag==1 && after>=y)
        {
            cout << j << endl;
            return 0;
        }
    }

    if(flag==1)
    {
        cout << j << endl;
        return 0;
    }
        cout << 1 << endl;

    return 0;
}

/*
3 1 1
1 2 1
*/


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int i,j=1,k,l,n,m,x,y, flag=1, before=0, after=0;

    cin >> n >> x >> y;;

    int arr[n];

    for(i=0; i<n; i++)
        scanf("%d", &arr[i]);

    for(i=1; i<n; i++)
    {
        //cout << " " << i <<endl;
        if(arr[i-1]>arr[i])
        {
            after=0;
            before++;
            j=i+1;
        }
        else
        {
            if(before>=x || i==1)
                flag=1;
            else
            {
                flag=0;
                before=0;
            }
            after++;
        }
        if(flag==1 && after>=y)
        {
            cout << j << endl;
            return 0;
        }
    }

    if(flag==1)
    {
        cout << j << endl;
        return 0;
    }
        cout << 1 << endl;

    return 0;
}

/*
3 1 1
1 2 1
*/


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int i,j,k,l,n,m,x,y, flag=1, before=0, after=0;

    cin >> n >> x >> y;;

    int arr[n];

    for(i=0; i<n; i++)
        scanf("%d", &arr[i]);

    for(i=1; i<n; i++)
    {
        //cout << " " << i <<endl;
        if(arr[i-1]>arr[i])
        {
            if(before==x)
                flag=1;
            if(flag==1 && after==y)
            {
                cout << i+1 << endl;
                return 0;
            }
            after++;
            before=0;
        }
        else
        {
            if(flag==1 && after==y)
            {
                cout << i << endl;
                return 0;
            }
            if(before==x)
                flag=1;
            flag=0;
            after=0;
            before++;
        }
    }

    if(flag==1)
    {
        cout << i << endl;
        return 0;
    }
    cout << 1 << endl;

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int i,j,t,n,x,y;
    cin >> n >> x >> y;
    int arr[n];
    for(i=0; i<n; i++)
    {
        cin >> arr[i];
    }
    int count=0;
    for(i=0; i<n; i++)
    {
        int flag=1;
        for(j=i-1; j>=max(i-x,0); j--)
            if(arr[j]<arr[i])
            {
                flag=0;
                break;
            }
        if(flag)
        {
            for(j=i+1; j<=min(i+y,n-1); j++)
                if(arr[j]<arr[i])
                {
                    flag=0;
                    break;
                }
        }
        if(flag)
        {
            cout << i+1 << endl;
            return 0;
        }
    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int i,j=1,k,l,n,m,x,y, flag=1, before=0, after=0;

    cin >> n >> x >> y;;

    int arr[n];

    for(i=0; i<n; i++)
        scanf("%d", &arr[i]);

    for(i=1; i<n; i++)
    {
        //cout << " " << i <<endl;
        if(arr[i-1]>arr[i])
        {
            if(after)
                flag=0;
            after=0;
            before++;
            j=i+1;
            if(before>=x)
                flag=1;
        }
        else if(arr[i-1]<arr[i])
        {
            before=0;
            after++;
            if(flag==1 && after>=y)
            {
                cout << j << endl;
                return 0;
            }
        }
    }

    if(flag==1)
    {
        cout << j << endl;
        return 0;
    }
        //cout << 1 << endl;

    return 0;
}

/*
3 1 1
2 3 1
*/


#include <bits/stdc++.h>
using namespace std;
long long int sort2(long long int *ara, long int i, long int k)
{
    long long int ara2[k+1];
    for(long int l = 0; l <= k; l++)
    {
        ara2[l]=*(ara+i);
        i++;
    }
    sort(ara2, ara2+k+1);
    return ara2[0];
}

int main()
{
    long int n, x, y;
    cin>>n>>x>>y;
    long long int ara2[n-x];
    long long int ara[100001];
    for(long int i = 0; i < n; i++)
    {
        cin>>ara[i];
    }
    for(long int i = 0; i < n-x; i++)
    {
        ara2[i] = sort2(ara, i, i+x+y);
        //cout<<ara2[i]<<endl;
    }

    long int j = 0;
    if(x>=n){
                cout<<ara2[0]<<endl;
                return 0;

        }
    for(long int i = x; i < n-x; i++)
    {

        if(ara[i]==ara2[j++])
        {
            cout<<i+1<<endl;
            return 0;
        }
    }

}


#include <bits/stdc++.h>
using namespace std;
int main()
{
    long int n, x, y;
    long long int min = 1000000001;
    cin>>n>>x>>y;
    long long int ara[n+1];
    for(long int i = 0; i < n; i++)
    {
        cin>>ara[i];
    }
    ara[n]=1000001;
    vector<long long int>X;
    vector<long long int>Y;
    bool ase = true;
    for(long int i = x; i < n; i++)
    {
        int x1 = x;
        ase = true;
        for(int j = i-1; x1 > 0; x1--, j--)
        {
            if(ara[j]<=ara[i])
            {
                ase = false;
                break;
            }

        }
        int x2 = y;
        ase = true;
        for(int j = i+1; x2 >= 0; x2--, j++)
        {
            if(ara[j]<=ara[i])
            {
                ase = false;
                break;
            }
        }
        if(ase == true)
        {
            X.push_back(ara[i]);
            ase = true;
        }
    }

    /*for(long int i = n-y-1; i >= 0; i--)
    {
        int x2 = y;
        ase = true;
        for(int j = i+1; x2 > 0; x2--, j++)
        {
            if(ara[j]<=ara[i])
            {
                ase = false;
                break;
            }

        }
        if(ase == true)
        {
            Y.push_back(ara[i]);
        }
    }*/
    //int i = 0;
    sort(X.begin(), X.end());

    //sort(Y.begin(), Y.end());
    //for(int i = 0; i < X.size(); i++)cout<<X[i]<<" ,,,,, ";
    //cout<<"sesh"<<endl;
    //cout<<endl;
    //for(int i = 0; i < Y.size(); i++)cout<<Y[i]<<" ";
    //cout<<endl;
    //long long int d = 100001;
    /*if(X.size()>Y.size()){
            while(i<Y.size())
    {
        for(long int j = 0; j < n; j++)
        {
            if(Y[i]==ara[j] && j < d)d=j;
        }
        i++;
    }}
      else{  while(i<X.size())
    {
        for(long int j = 0; j < n; j++)
        {
            if(Y[i]==ara[j] && j < d)d=j;
        }
        i++;
    }}
    cout<<d+1<<endl;
    */
    if(y==n)
    {
        cout<<n<<endl;
        return 0;
    }
    if(x==n)
    {
        cout<<1<<endl;
        return 0;
    }

    long int d = 100001;

    for(long int k = 0; k < X.size(); k++){
        for(long int j = 0; j < n; j++)
        {
            if(X[k]==ara[j] && j < d)
            {
             d = j;
            }
        }

    }
    cout<<d+1<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long int sort2(long long int *ara, long int i, long int k)
{
    long long int ara2[k+1];
    for(long int l = 0; l <= k; l++)
    {
        ara2[l]=*(ara+i);
        i++;
    }
    sort(ara2, ara2+k+1);
    return ara2[0];
}

int main()
{
    long int n, x, y;
    cin>>n>>x>>y;
    long long int ara2[n-x];
    long long int ara[n];
    for(long int i = 0; i < n; i++)
    {
        cin>>ara[i];
    }
    for(long int i = 0; i <= n-x; i++)
    {
        ara2[i] = sort2(ara, i, i+x+y);
        //cout<<ara2[i]<<endl;
    }

    long int j = 0;
    if(x>=n){
                cout<<ara2[0]<<endl;
                return 0;

        }
    for(long int i = x; i < n-x; i++)
    {

        if(ara[i]==ara2[j++])
        {
            cout<<i+1<<endl;
            return 0;
        }
    }

}


#include <bits/stdc++.h>
using namespace std;
long long int sort2(long long int ara[], long int i, long int k)
{
    long long int ara2[k+1];
    for(long int l = 0; l <= k; l++)
    {
        ara2[l]=ara[i];
        i++;
    }
    sort(ara2, ara2+k+1);
    return ara2[0];
}

int main()
{
    long int n, x, y;
    cin>>n>>x>>y;
    long long int ara2[n-x];
    long long int ara[n];
    for(long int i = 0; i < n; i++)
    {
        cin>>ara[i];
    }
    for(long int i = 0; i <= n-x; i++)
    {
        ara2[i] = sort2(ara, i, i+x+y);
        //cout<<ara2[i]<<endl;
    }

    long int j = 0;
    if(x>=n){
                cout<<ara2[0]<<endl;
                return 0;

        }
    for(long int i = x; i < n-x; i++)
    {

        if(ara[i]==ara2[j++])
        {
            cout<<i+1<<endl;
            return 0;
        }
    }

}


#include <bits/stdc++.h>
using namespace std;
int main()
{
    long int n, x, y;
    long long int min = 1000000001;
    cin>>n>>x>>y;
    long long int ara[n];
    for(long int i = 0; i < n; i++)
    {
        cin>>ara[i];
    }
    vector<long long int>X;
    vector<long long int>Y;
    bool ase = true;
    for(long int i = x; i < n; i++)
    {
        int x1 = x;
        ase = true;
        for(int j = i-1; x1 > 0; x1--, j--)
        {
            if(ara[j]<=ara[i])
            {
                ase = false;
                break;
            }

        }
        int x2 = y;
        ase = true;
        for(int j = i+1; x2 >= 0; x2--, j++)
        {
            if(ara[j]<=ara[i])
            {
                ase = false;
                break;
            }
        }
        if(ase == true)
        {
            X.push_back(ara[i]);
            ase = true;
        }
    }

    /*for(long int i = n-y-1; i >= 0; i--)
    {
        int x2 = y;
        ase = true;
        for(int j = i+1; x2 > 0; x2--, j++)
        {
            if(ara[j]<=ara[i])
            {
                ase = false;
                break;
            }

        }
        if(ase == true)
        {
            Y.push_back(ara[i]);
        }
    }*/
    //int i = 0;
    sort(X.begin(), X.end());

    //sort(Y.begin(), Y.end());
    //for(int i = 0; i < X.size(); i++)cout<<X[i]<<" ,,,,, ";
    //cout<<"sesh"<<endl;
    //cout<<endl;
    //for(int i = 0; i < Y.size(); i++)cout<<Y[i]<<" ";
    //cout<<endl;
    //long long int d = 100001;
    /*if(X.size()>Y.size()){
            while(i<Y.size())
    {
        for(long int j = 0; j < n; j++)
        {
            if(Y[i]==ara[j] && j < d)d=j;
        }
        i++;
    }}
      else{  while(i<X.size())
    {
        for(long int j = 0; j < n; j++)
        {
            if(Y[i]==ara[j] && j < d)d=j;
        }
        i++;
    }}
    cout<<d+1<<endl;
    */
    if(y==n)
    {
        cout<<n<<endl;
        return 0;
    }
    if(x==n)
    {
        cout<<1<<endl;
        return 0;
    }

    long int d = 100001;

    for(long int k = 0; k < X.size(); k++){
        for(long int j = 0; j < n; j++)
        {
            if(X[k]==ara[j] && j < d)
            {
             d = j;
            }
        }

    }
    cout<<d+1<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
    long int n, x, y;
    bool ase = true;
    cin>>n>>x>>y;
    long long int ara[n];
    for(long int i = 0; i < n; i++)cin>>ara[i];
    for(long int i = 0; i < n; i++)
    {
        for(long int j = i-1; j >= (i-x); j--)
        {
            if(ara[j]<=ara[i])
            {

                ase = false;
                break;
            }
        }
        //cout<<endl;
        if(ase==true)
        {
            for(long int k = i+1; k <= (i+y); k++)
            {
                if(ara[k]<=ara[i])
                {
                    ase = false;
                    break;
                }
            }
        }

        if(ase == true)
        {
            cout<<i+1<<endl;
            return 0;
        }
        else{
            ase = true;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long int sort2(long long int ara[], long int i, long int k)
{
    long long int ara2[k+1];
    for(long int l = 0; l <= k; l++)
    {
        ara2[l]=ara[i++];
    }
    sort(ara2, ara2+k+1);
    return ara2[0];
}

int main()
{
    long int n, x, y;
    cin>>n>>x>>y;
    long long int ara2[n-x];
    long long int ara[n];
    for(long int i = 0; i < n; i++)
    {
        cin>>ara[i];
    }
    for(long int i = 0; i <= n-x; i++)
    {
        ara2[i] = sort2(ara, i, i+x+y);
        //cout<<ara2[i]<<endl;
    }

    long int j = 0;
    if(x>=n){
                cout<<ara2[0]<<endl;
                return 0;

        }
    for(long int i = x; i < n-x; i++)
    {

        if(ara[i]==ara2[j++])
        {
            cout<<i+1<<endl;
            return 0;
        }
    }

}


#include <bits/stdc++.h>
using namespace std;
long long int find(long long int ara[], long int i, long int j)
{
    long int n = j - i + 1;
    long long int carray[n];
    memset(carray, 0, n*sizeof(long long int));

    for(long int k = 0; k < n; k++)
    {
        carray[k] = ara[i++];
       // cout<<carray[k]<<" ";
    }
    //cout<<endl;
    sort(carray, carray+n);
    return carray[0];
}
int main()
{
    long int n, x, y, j;
    cin>>n>>x>>y;
    long long int ara[n+2];
    long long int day[n-x+1];
    for(long int i = 0, j = 0; i < n; i++)
    {
        cin>>ara[i];
        if(i>=(x))
        {
            day[j++] = ara[i];
        }
    }
    if(x==n)
    {
        cout<<x<<endl;
        return 0;
    }
    ara[n] = 1000000001;
    ara[n+1] = 1000000001;
    for(long int i = 0, j = x + y; i < n-x; i++, j++)
    {

       long long int m = find(ara, i, j);
      //cout<<m<<" ";
       if(m==day[i])
       {

           cout<<x+i+1<<endl;
           return 0;
       }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
    long int n, x, y;
    bool ase = true;
    cin>>n>>x>>y;
    long long int ara[n];
    for(long int i = 0; i < n; i++)cin>>ara[i];
    for(long int i = 0; i < n; i++)
    {
        for(long int j = i-1; j >= (i-x) && j >= 0; j--)
        {
            if(ara[j]<=ara[i])
            {

                ase = false;
                break;
            }
        }
        //cout<<endl;
        if(ase==true)
        {
            for(long int k = i+1; k <= (i+y) && k < n; k++)
            {
                if(ara[k]<=ara[i])
                {
                    ase = false;
                    break;
                }
            }
        }

        if(ase == true)
        {
            cout<<i+1<<endl;
            return 0;
        }
        else{
            ase = true;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long int sort2(long long int *ara, long int i, long int k)
{
    long long int ara2[k+1];
    for(long int l = 0; l <= k; l++)
    {
        ara2[l]=*(ara+i);
        i++;
    }
    sort(ara2, ara2+k+1);
    return ara2[0];
}

int main()
{
    long int n, x, y;
    cin>>n>>x>>y;
    long long int ara2[n-x];
    long long int ara[n];
    for(long int i = 0; i < n; i++)
    {
        cin>>ara[i];
    }
    if(x>=n){
                cout<<ara[n-1]<<endl;
                return 0;

        }
    for(long int i = 0; i < n-x; i++)
    {
        ara2[i] = sort2(ara, i, i+x+y);
        //cout<<ara2[i]<<endl;
    }

    long int j = 0;

    for(long int i = x; i < n-x; i++)
    {

        if(ara[i]==ara2[j++])
        {
            cout<<i+1<<endl;
            return 0;
        }
    }

}


#include <bits/stdc++.h>
using namespace std;
long long int find(long long int ara[], long int i, long int j)
{
    long int n = j - i + 1;
    long long int carray[n];
    memset(carray, 0, n*sizeof(long long int));

    for(long int k = 0; k < n; k++)
    {
        carray[k] = ara[i++];
       // cout<<carray[k]<<" ";
    }
    //cout<<endl;
    sort(carray, carray+n);
    return carray[0];
}
int main()
{
    long int n, x, y, j;
    cin>>n>>x>>y;
    long long int ara[n+2];
    long long int day[n-x+1];
    for(long int i = 0, j = 0; i < n; i++)
    {
        cin>>ara[i];
        if(i>=(x))
        {
            day[j++] = ara[i];
        }
    }
    if(x==n)
    {
        cout<<ara[x-1]<<endl;
        return 0;
    }
    ara[n] = 1000000001;
    ara[n+1] = 1000000001;
    for(long int i = 0, j = x + y; i < n-x; i++, j++)
    {

       long long int m = find(ara, i, j);
      //cout<<m<<" ";
       if(m==day[i])
       {

           cout<<x+i+1<<endl;
           return 0;
       }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
    long int n, x, y;
    long long int min = 1000000001;
    cin>>n>>x>>y;
    long long int ara[n];
    for(long int i = 0; i < n; i++)
    {
        cin>>ara[i];
    }
    vector<long long int>X;
    vector<long long int>Y;
    bool ase = true;
    for(long int i = x; i < n; i++)
    {
        int x1 = x;
        ase = true;
        for(int j = i-1; x1 > 0; x1--, j--)
        {
            if(ara[j]<=ara[i])
            {
                ase = false;
                break;
            }

        }
        int x2 = y;
        ase = true;
        for(int j = i+1; x2 > 0; x2--, j++)
        {
            if(ara[j]<=ara[i])
            {
                ase = false;
                break;
            }
        }
        if(ase == true)
        {
            X.push_back(ara[i]);
            ase = true;
        }
    }

    /*for(long int i = n-y-1; i >= 0; i--)
    {
        int x2 = y;
        ase = true;
        for(int j = i+1; x2 > 0; x2--, j++)
        {
            if(ara[j]<=ara[i])
            {
                ase = false;
                break;
            }

        }
        if(ase == true)
        {
            Y.push_back(ara[i]);
        }
    }*/
    //int i = 0;
    sort(X.begin(), X.end());

    //sort(Y.begin(), Y.end());
    //for(int i = 0; i < X.size(); i++)cout<<X[i]<<" ,,,,, ";
    //cout<<"sesh"<<endl;
    //cout<<endl;
    //for(int i = 0; i < Y.size(); i++)cout<<Y[i]<<" ";
    //cout<<endl;
    //long long int d = 100001;
    /*if(X.size()>Y.size()){
            while(i<Y.size())
    {
        for(long int j = 0; j < n; j++)
        {
            if(Y[i]==ara[j] && j < d)d=j;
        }
        i++;
    }}
      else{  while(i<X.size())
    {
        for(long int j = 0; j < n; j++)
        {
            if(Y[i]==ara[j] && j < d)d=j;
        }
        i++;
    }}
    cout<<d+1<<endl;
    */
    if(x==n||y==n)
    {
        cout<<n<<endl;
        return 0;
    }

    long int d = 100001;

    for(long int k = 0; k < X.size(); k++){
        for(long int j = 0; j < n; j++)
        {
            if(X[k]==ara[j] && j < d)
            {
             d = j;
            }
        }

    }
    cout<<d+1<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long int find(long long int ara[], long int i, long int j)
{
    long int n = j - i + 1;
    long long int carray[n];
    memset(carray, 0, n*sizeof(long long int));

    for(long int k = 0; k < n; k++)
    {
        carray[k] = ara[i++];
       // cout<<carray[k]<<" ";
    }
    //cout<<endl;
    sort(carray, carray+n);
    return carray[0];
}
int main()
{
    long int n, x, y, j;
    cin>>n>>x>>y;
    long long int ara[n+2];
    long long int day[n-x];
    for(long int i = 0, j = 0; i < n; i++)
    {
        cin>>ara[i];
        if(i>=(x))
        {
            day[j++] = ara[i];
        }
    }
    if(x==n)
    {
        cout<<ara[x-1]<<endl;
        return 0;
    }
    ara[n] = 1000000001;
    ara[n+1] = 1000000001;
    for(long int i = 0, j = x + y; i < n-x; i++, j++)
    {

       long long int m = find(ara, i, j);
      //cout<<m<<" ";
       if(m==day[i])
       {

           cout<<x+i+1<<endl;
           return 0;
       }
    }
    return 0;
}


#include <iostream>
using namespace std;
int main()
{
	int i, n,x,y,k=0;cin>>n>>x>>y;int arr[n+x+y];
	for ( i=0;i<x;i++)arr[i]=10000000;
	for ( i=n+x;i<n+x+y;i++)arr[i]=10000000;
	for ( i=x;i<n+x;i++)cin>>arr[i];
	for ( i=x;(i<n+x)&&k==0;i++)
	{
	k=1;
		for(int j=i-x;j<i;j++)
		{
			if (arr[j]<arr[i]){
			k=0;break;
		}}
		for(int j=i+1;j<(i+y+1)&&k==1;j++){
			if(arr[j]<arr[i]){
			k=0;break;}
		}
	}

cout<<i-x;
}


#include <iostream>
#define ll long long int
using namespace std;
int main()
{
	ll i, n,x,y,k=0;cin>>n>>x>>y;ll arr[n+x+y];
	for ( i=0;i<x;i++)arr[i]=9000000000;
	for ( i=n+x;i<n+x+y;i++)arr[i]=9000000000;
	for ( i=x;i<n+x;i++)cin>>arr[i];
	for ( i=x;(i<n+x)&&k==0;i++)
	{
	k=1;
		for(int j=i-x;j<i;j++)
		{
			if (arr[j]<arr[i]){
			k=0;break;
		}}
		for(int j=i+1;j<(i+y+1)&&k==1;j++){
			if(arr[j]<arr[i]){
			k=0;break;}
		}
	}

cout<<i-x;
}


#include <iostream>
using namespace std;
int main()
{
	int i, n,x,y,k=0;cin>>n>>x>>y;int arr[n];
	for ( i=0;i<n;i++)cin>>arr[i];
	for ( i=x;(i<n-y)&&k==0;i++)
	{
	k=1;
		for(int j=0;j<x;j++)
		{
			if (arr[j]<arr[i]){
			k=0;break;
		}}
		for(int j=i+1;j<(i+y+1)&&k==1;j++){
			if(arr[j]<arr[i]){
			k=0;break;}
		}
	}

	if(i==(n-y))i++;
	cout<<i;
}


#include <iostream>
using namespace std;
int main()
{
	int i, n,x,y,k=0;cin>>n>>x>>y;int arr[n];
	for ( i=0;i<n;i++)cin>>arr[i];
	for ( i=x;(i<n-y)&&k==0;i++)
	{
	k=1;
		for(int j=0;j<x;j++)
		{
			if (arr[j]<arr[i]){
			k=0;break;
		}}
		for(int j=i+1;j<(i+y+1)&&k==1;j++){
			if(arr[j]<arr[i]){
			k=0;break;}
		}
	}

	if(i==(n-y)&&y!=0)i++;
	cout<<i;
}


#include <iostream>
using namespace std;
int main()
{
	int i, n,x,y,k=0;cin>>n>>x>>y;int arr[n];
	for ( i=0;i<n;i++)cin>>arr[i];
	for ( i=x;(i<n-y)&&k==0;i++)
	{
	k=1;
		for(int j=0;j<x;j++)
		{
			if (arr[j]<arr[i]){
			k=0;break;
		}}
		for(int j=i+1;j<(i+y+1)&&k==1;j++){
			if(arr[j]<arr[i]){
			k=0;break;}
		}
	}

	if(i==(n-y)&&y!=0)i++;
	if(n==2&&x==1&&y==0)i--;
	cout<<i;
}


#include <iostream>
#define ll long long int
using namespace std;
int main()
{
	ll i, n,x,y,k=0;cin>>n>>x>>y;ll arr[n+x+y];
	for ( i=0;i<x;i++)arr[i]=10000000;
	for ( i=n+x;i<n+x+y;i++)arr[i]=10000000;
	for ( i=x;i<n+x;i++)cin>>arr[i];
	for ( i=x;(i<n+x)&&k==0;i++)
	{
	k=1;
		for(int j=i-x;j<i;j++)
		{
			if (arr[j]<arr[i]){
			k=0;break;
		}}
		for(int j=i+1;j<(i+y+1)&&k==1;j++){
			if(arr[j]<arr[i]){
			k=0;break;}
		}
	}

cout<<i-x;
}


#include<bits/stdc++.h>
using namespace std;

long long int solve(long long int k,vector<int>a,int x ,int y,long long int n){
    ios::sync_with_stdio(false),cin.tie(0);
    if(k!=0){
      for(int i=k-1;i>=(k-x);i--){
        if(a[k]>a[i]){
             return 0;
         }
         if(i==0){
            break;
         }
      }
    }
     if(k!=(n-1)){
    for(int i=k+1;i<=(k+y);i++){

        if(a[k]>a[i]){
            return 0;
        }
    if(i==(n-1)){
            break;
          }

      }
     }

    return(k+1);
}

int main(){
 ios::sync_with_stdio(false),cin.tie(0);
 long long int n;
 cin>>n;
 int x,y;
 cin>>x>>y;
 vector<int> a(n);
 for(long long int i=0;i<n;i++){
    cin>>a[i] ;
 }
for(long long int i=0;i<n;i++){
    long long int f=solve(i,a,x,y,n);
    if(f!=0){

            cout<<f<<endl;
            break;}
}

return 0;
}


#include<bits/stdc++.h>
using namespace std;

long long int solve(long long int k,vector<long long int>a,int x ,int y,long long int n){
    ios::sync_with_stdio(false),cin.tie(0);
    if(k!=0){
      for(int i=k-1;i>=(k-x);i--){
        if(a[k]>a[i]){
             return 0;
         }
         if(i==0){
            break;
         }
      }
    }
     if(k!=(n-1)){
    for(int i=k+1;i<=(k+y);i++){

        if(a[k]>a[i]){
            return 0;
        }
    if(i==(n-1)){
            break;
          }

      }
     }

    return(k+1);
}

int main(){
 ios::sync_with_stdio(false),cin.tie(0);
 long long int n;
 cin>>n;
 int x,y;
 cin>>x>>y;
 vector<long long int> a(n);
 for(long long int i=0;i<n;i++){
    cin>>a[i] ;
 }
for(long long int i=0;i<n;i++){
    long long int f=solve(i,a,x,y,n);
    if(f!=0){

            cout<<f<<endl;
            break;}
}

return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
    ios::sync_with_stdio(false),cin.tie(0);
    long long int n,x,y;cin>>n>>x>>y;
    vector<long long int>a(n);
    for(long long int i=0;i<n;i++){
        cin>>a[i];
    }
    long long int i;
    for(long long int j=0;j<n;j++){
        long long int temp1=min(x,(j-0));
        long long int temp2=min(y,(n-1-j));
        for(i=j-temp1;i<=(j+temp2);i++){
            if(i==j){
                continue;
            }
            if(a[i]<a[j]){
                break;
            }
        }
        if(i>(j+temp2)){
            cout<<j+1<<endl;
            break;
        }

    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")

/// Typedef
typedef long long ll;

#define sc1(a) scanf("%lld",&a)
#define sc2(a,b) scanf("%lld %lld",&a,&b)

#define pf1(a) printf("%lld\n",a)
#define pf2(a,b) printf("%lld %lld\n",a,b)

#define mx 100007
#define mod 100000007
#define PI acos(-1.0)

#define size1 998244353
#define pb push_back

int main()
{

    ll m, tc, num, t = 1;

    sc2(num, m);
    sc1(tc);

    ll arr[num + 5];

    for(ll i = 1; i <= num; i++)
        sc1(arr[i]);

    for(ll i = 1; i <= num; i++){

        bool ck = true;
        for(ll j = max(i - m, (ll)1); j < i; j++) {
            if(arr[j] <= arr[i]) ck = false;
        }

        for(ll j = i + 1; j <= min(i + tc, num); j++) {
            if(arr[j] <= arr[i]) ck = false;
        }

        if(ck) return cout << i << endl,0;
    }

}


#include<bits/stdc++.h>
using namespace std;

long long int solve(long long int k,vector<int>a,int x ,int y,long long int n){
    ios::sync_with_stdio(false),cin.tie(0);
    if(k!=0 || k!=(n-1)){
      for(int i=k-1;i>=(k-x);i--){
        if(a[k]>a[i]){
             return 0;
         }
         if(i==0){
            break;
         }
      }

    for(int i=k+1;i<=(k+y);i++){

        if(a[k]>a[i]){
            return 0;
        }
    if(i==(n-1)){
            break;
          }

      }
     }

    return(k+1);
}

int main(){
 ios::sync_with_stdio(false),cin.tie(0);
 long long int n;
 cin>>n;
 int x,y;
 cin>>x>>y;
 vector<int> a(n);
 for(long long int i=0;i<n;i++){
    cin>>a[i] ;
 }
for(long long int i=0;i<n;i++){
    long long int f=solve(i,a,x,y,n);
    if(f!=0){

            cout<<f<<endl;
            break;}
}

return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main(){
  int n, x, y;
  cin >> n >> x >> y;
  vector <int> a(n);
  for (int i = 0; i < n; ++i){
  	cin >> a[i];
  }
  multiset <int> st1, st2;
  for (int i = 1; i < min(y, n); ++i){
  	st2.insert(a[i]);
  }
  for (int i = 0; i < n; ++i){
  	if (a[i] < *st1.begin() && a[i] < *st2.begin() || a[i] < *st1.begin() && st2.empty() || st1.empty() && a[i] < *st2.begin() || st1.empty() && st2.empty()){
  		cout << i + 1;
  		return 0;
  	}
  	if (st1.size() == x){
  		st1.erase(a[i - x]);
  	}
  	st1.insert(a[i]);
  	st2.erase(a[i + 1]);
  	if (i + y + 1 < n){
  		st2.insert(a[i + y + 1]);
  	}
  }
  cout << n;
  return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main(){
  int n, x, y;
  cin >> n >> x >> y;
  vector <int> a(n);
  for (int i = 0; i < n; ++i){
  	cin >> a[i];
  }
  multiset <int> st1, st2;
  for (int i = 1; i < min(y, n); ++i){
  	st2.insert(a[i]);
  }
  for (int i = 0; i < n; ++i){
  	if (a[i] < *st1.begin() && a[i] < *st2.begin() || a[i] < *st1.begin() && st2.empty() || st1.empty() && st2.empty()){
  		cout << i + 1;
  		return 0;
  	}
  	if (st1.size() == x){
  		st1.erase(a[i - x]);
  	}
  	st1.insert(a[i]);
  	st2.erase(a[i + 1]);
  	if (i + y + 1 < n){
  		st2.insert(a[i + y + 1]);
  	}
  }
  cout << n;
  return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main(){
  int n, x, y;
  cin >> n >> x >> y;
  vector <int> a(n);
  for (int i = 0; i < n; ++i){
  	cin >> a[i];
  }
  multiset <int> st1, st2;
  for (int i = 1; i < min(y, n); ++i){
  	st2.insert(a[i]);
  }
  for (int i = 0; i < n; ++i){
  	if (a[i] < *st1.begin() && a[i] < *st2.begin() || st1.empty() && a[i] < *st2.begin() || st1.empty() && st2.empty()){
  		cout << i + 1;
  		return 0;
  	}
  	if (st1.size() == x){
  		st1.erase(a[i - x]);
  	}
  	st1.insert(a[i]);
  	st2.erase(a[i + 1]);
  	if (i + y + 1 < n){
  		st2.insert(a[i + y + 1]);
  	}
  }
  cout << n;
  return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main(){
  int n, x, y;
  cin >> n >> x >> y;
  vector <int> a(n);
  for (int i = 0; i < n; ++i){
  	cin >> a[i];
  }
  multiset <int> st1, st2;
  for (int i = 1; i < min(y + 1, n); ++i){
  	st2.insert(a[i]);
  }
  for (int i = 0; i < n; ++i){
  	if (a[i] < *st1.begin() && a[i] < *st2.begin() || st1.empty() && st2.empty() || st1.empty() && a[i] < *st2.begin()){
  		cout << i + 1;
  		return 0;
  	}
  	if (st1.size() == x){
  		st1.erase(a[i - x]);
  	}
  	st1.insert(a[i]);
  	st2.erase(a[i + 1]);
  	if (i + y + 1 < n){
  		st2.insert(a[i + y + 1]);
  	}
  }
  cout << n;
  return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main(){
  int n, x, y;
  cin >> n >> x >> y;
  vector <int> a(n);
  for (int i = 0; i < n; ++i){
  	cin >> a[i];
  }
  multiset <int> st1, st2;
  for (int i = 1; i < min(y + 1, n); ++i){
  	st2.insert(a[i]);
  }
  for (int i = 0; i < n; ++i){
  	if (a[i] < *st1.begin() && a[i] < *st2.begin() || st1.empty() && st2.empty()){
  		cout << i + 1;
  		return 0;
  	}
  	if (st1.size() == x){
  		st1.erase(a[i - x]);
  	}
  	st1.insert(a[i]);
  	st2.erase(a[i + 1]);
  	if (i + y + 1 < n){
  		st2.insert(a[i + y + 1]);
  	}
  }
  cout << n;
  return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main(){
  int n, x, y;
  cin >> n >> x >> y;
  vector <int> a(n);
  for (int i = 0; i < n; ++i){
  	cin >> a[i];
  }
  multiset <int> st1, st2;
  for (int i = 1; i < min(y, n); ++i){
  	st2.insert(a[i]);
  }
  for (int i = 0; i < n; ++i){
  	if (a[i] < *st1.begin() && a[i] < *st2.begin() || a[i] < *st1.begin() && st2.empty() || st1.empty() && a[i] < *st2.begin()){
  		cout << i + 1;
  		return 0;
  	}
  	if (st1.size() == x){
  		st1.erase(a[i - x]);
  	}
  	st1.insert(a[i]);
  	st2.erase(a[i + 1]);
  	if (i + y + 1 < n){
  		st2.insert(a[i + y + 1]);
  	}
  }
  cout << n;
  return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main(){
  int n, x, y;
  cin >> n >> x >> y;
  vector <int> a(n);
  for (int i = 0; i < n; ++i){
  	cin >> a[i];
  }
  multiset <int> st1, st2;
  for (int i = 1; i < min(y + 1, n); ++i){
  	st2.insert(a[i]);
  }
  for (int i = 0; i < n; ++i){
  	if (a[i] < *st1.begin() && a[i] < *st2.begin()){
  		cout << i + 1;
  		return 0;
  	}
  	if (st1.size() == x){
  		st1.erase(a[i - x]);
  	}
  	st1.insert(a[i]);
  	st2.erase(a[i + 1]);
  	if (i + y + 1 < n){
  		st2.insert(a[i + y + 1]);
  	}
  }
  cout << n;
  return 0;
}


#include<iostream>
#include<string>
#include<cmath>
using namespace std;
int main()
{
	long long int n,x,y;
	while(cin>>n)
	{
		cin>>x>>y;
		long long int wea[n]={0},ans=-1,t;
		for(long long int i=0;i<n;i++)
			cin>>wea[i];
		for(long long int i=x;i<n;i++)
		{
			if(i+y>=n)
				t=n-1;
			else
				t=i+y;
			for(long long int j=i-x;j<=t;j++)
			{
				//cout<<ans<<" "<<wea[i]<<" "<<wea[j]<<endl;
				if(wea[i]>wea[j])
				{
					ans=-1;
					break;
				}
				if(j==t)
					ans=0;
			}
			if(ans==0)
			{
				ans=i;
				break;
			}
		}
		if(ans!=-1)
			cout<<ans+1<<endl;
		else
		{
			ans=1000000000;
			long long int num;
			for(long long int i=0;i<n;i++)
			{
				if(ans>wea[i])
				{
					ans=wea[i];
					num=i;
				}
			}
			cout<<num+1<<endl;
		}

	}
	return 0;
}


#include<iostream>
#include<string>
#include<cmath>
using namespace std;
int main()
{
	int n,x,y;
	while(cin>>n)
	{
		cin>>x>>y;
		int wea[n]={0},ans=-1,t;
		for(int i=0;i<n;i++)
			cin>>wea[i];
		for(int i=x;i<n;i++)
		{
			if(i+y>=n)
				t=n-1;
			else
				t=i+y;
			for(int j=i-x;j<=t;j++)
			{
				//cout<<t<<" "<<wea[i]<<" "<<wea[j]<<endl;
				if(wea[i]>wea[j])
				{
					ans=0;
					break;
				}
				ans=-1;
			}
			if(ans!=0)
			{
				ans=i;
				break;
			}
		}
		if(ans!=-1)
			cout<<ans+1<<endl;
		else
			cout<<n<<endl;

	}
	return 0;
}


#include<iostream>
#include<string>
#include<cmath>
using namespace std;
int main()
{
	int n,x,y;
	while(cin>>n)
	{
		cin>>x>>y;
		int wea[n]={0},ans=-1;
		for(int i=0;i<n;i++)
			cin>>wea[i];
		for(int i=x;i<n;i++)
		{
			for(int j=i-x;j<=i+y;j++)
			{
				//cout<<wea[i]<<" "<<wea[j]<<endl;
				if(wea[i]>wea[j])
				{
					ans=0;
					break;
				}
				ans=-1;
			}
			if(ans!=0)
			{
				ans=i;
				break;
			}
		}
		if(ans!=-1)
			cout<<ans+1<<endl;
		else
			cout<<n<<endl;

	}
	return 0;
}


#include<iostream>
#include<string>
#include<cmath>
using namespace std;
int main()
{
	long long int n,x,y;
	while(cin>>n)
	{
		cin>>x>>y;
		long long int wea[n]={0},ans=-1,t;
		for(long long int i=0;i<n;i++)
			cin>>wea[i];
		for(long long int i=x;i<n;i++)
		{
			if(i+y>=n)
				t=n-1;
			else
				t=i+y;
			for(long long int j=i-x;j<=t;j++)
			{
				//cout<<ans<<" "<<wea[i]<<" "<<wea[j]<<endl;
				if(wea[i]>wea[j])
				{
					ans=-1;
					break;
				}
				if(j==t)
					ans=0;
			}
			if(ans==0)
			{
				ans=i;
				break;
			}
		}
		long long a=1000000000;
		long long int num;
		for(long long int i=0;i<n;i++)
		{
			if(a>wea[i])
			{
				a=wea[i];
				num=i;
			}
		}

		if(ans!=-1&&num>ans)
			cout<<ans+1<<endl;
		else
			cout<<num+1<<endl;

	}
	return 0;
}


#include<iostream>
#include<string>
#include<cmath>
using namespace std;
int main()
{
	long long int n,x,y;
	while(cin>>n)
	{
		cin>>x>>y;
		long long int wea[n]={0},ans=-1,t;
		for(long long int i=0;i<n;i++)
			cin>>wea[i];
		for(long long int i=x;i<n;i++)
		{
			if(i+y>=n)
				t=n-1;
			else
				t=i+y;
			for(long long int j=i-x;j<=t;j++)
			{
				//cout<<ans<<" "<<wea[i]<<" "<<wea[j]<<endl;
				if(i==j)
					continue;
				if(wea[i]>=wea[j])
				{
					ans=-1;
					break;
				}
				if(j==t)
					ans=0;
			}
			if(ans==0)
			{
				ans=i;
				break;
			}
		}
		long long a=1000000000;
		long long int num;
		for(long long int i=0;i<n;i++)
		{
			if(a>wea[i])
			{
				a=wea[i];
				num=i;
			}
		}

		if(ans!=-1&&num>ans)
			cout<<ans+1<<endl;
		else
			cout<<num+1<<endl;

	}
	return 0;
}


#include<iostream>
#include<string>
#include<cmath>
using namespace std;
int main()
{
	int n,x,y;
	while(cin>>n)
	{
		cin>>x>>y;
		long long int wea[n]={0},ans=-1,t;
		for(int i=0;i<n;i++)
			cin>>wea[i];
		for(int i=x;i<n;i++)
		{
			if(i+y>=n)
				t=n-1;
			else
				t=i+y;
			for(int j=i-x;j<=t;j++)
			{
				//cout<<t<<" "<<wea[i]<<" "<<wea[j]<<endl;
				if(wea[i]>wea[j])
				{
					ans=0;
					break;
				}
				ans=-1;
			}
			if(ans!=0)
			{
				ans=i;
				break;
			}
		}
		if(ans!=-1)
			cout<<ans+1<<endl;
		else
		{
			ans=1000000000;
			int num;
			for(int i=0;i<n;i++)
			{
				if(ans>wea[i])
				{
					ans=wea[i];
					num=i;
				}
			}
			cout<<num+1<<endl;
		}

	}
	return 0;
}