#include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
const int Maxn=100000+10;
int a[Maxn],f[Maxn<<2];
int n,m;
inline int read()
{
    int s=0,w=1;
    char ch=getchar();
    while(ch<'0' || ch>'9'){if(ch=='-')w=-1;ch=getchar();}
    while(ch>='0' && ch<='9')s=(s<<3)+(s<<1)+(ch^48),ch=getchar();
    return s*w;
}
void build(int k,int l,int r)
{
    if(l==r)
    {
        f[k]=l;
        return;
    }
    int mid=(l+r)>>1;
    build(k<<1,l,mid);
    build(k<<1|1,mid+1,r);
    if(a[f[k<<1]]>a[f[k<<1|1]])
    f[k]=f[k<<1];
    else f[k]=f[k<<1|1];
}
int main()
{
    // freopen("in.txt","r",stdin);
    m=read();
    n=(1<<m);
    for(int i=1;i<=n;++i)
    a[i]=read();
    build(1,1,n);
    int x=f[2],y=f[3];
    if(a[x]<a[y])printf("%d\n",x);
    else printf("%d\n",y);
    return 0;
}
#pragma region header
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n)for(int i=0;i<(n);i++)
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define pb push_back
#define int ll
#define each(i, a) for (auto &&i : (a))
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vi>;
using vs = vector<string>;
using vvs = vector<vs>;
using vd = vector<ld>;
using vvd = vector<vd>;
using vb = vector<bool>;
using vvb = vector<vb>;
using P = pair<int, int>;
using vp = vector<P>;
using int128 = __int128_t;//cin coutはできない
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return a / gcd(a, b) * b;};
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

template <class T>
void CVEC(const T &v) {
	int c = v.size() - 1;
	for (int i = 0; i < c; i++) cout << v[i] << ' ';
	if (c > -1) cout << v[c];
	cout << '\n';
}

#pragma endregion header

signed main(){
    int n, w;
	cin >> n >> w;
	cout << n / w << endl;
}