#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <iomanip>
#include <queue>
#include <deque>
#include <map>
#include <unordered_map>
#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,n) for(int i=1;i<=n;i++)
#define repr(e,x) for(auto& e:x)
using namespace std;
typedef long long ll;
typedef long double ld;
//typedef pair<int,int> P;
double const PI=3.141592653589793;
int const INF=1001001001;
ll const LINF=1001001001001001001;
ll const MOD=1000000007;

ll mpow(ll x,ll n){
    if(n==0) return 1;
    else if(n%2) return x*mpow(x,n-1);
    return mpow(x*x,n/2);
}

ll mfrac(ll n){
    if(n==0) return 1;
    else return n*mfrac(n-1);
}

ll mperm(ll n,ll r){
    ll res=1;
    for(ll i=0;i<r;i++) res=res*(n-i);
    return res;
}

ll mcomb(ll n,ll r){
    if(r>n-r) r=n-r;
    ll res=mperm(n,r);
    res/=mfrac(r);
    return res;
}

ll L;
ll p[201][201];

int main(){
    cin>>L;

    p[0][0]=1;
    repn(n,L){
        p[n][0]=1;
        p[n][n]=1;
        repn(k,n-1) p[n][k]=p[n-1][k-1]+p[n-1][k];
    }
    cout<<p[L-1][11]<<endl;
    
    return 0;
}
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;
using namespace std;
#define int long long
#define pb push_back
#define deb(x) cerr << #x << " is " << x << endl;
const int N = 3e5 + 5, MOD = 998244353; //1e9 + 7;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
//typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
//typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_multiset;
#define ff first
#define ss second
int T;

int maxx = (1 << 16);

int a[(1 << 16) + 5];
pair<int, int> tree[4*(1 << 16) + 5];

void build(int node,int start,int end){
    if(start==end)  tree[node].ff=a[start], tree[node].ss=start;
    else{
        int mid=(start+end)/2;
        build(2*node,start,mid);
        build(2*node+1,mid+1,end);
        if(tree[2*node].ff>tree[2*node+1].ff)
            tree[node].ff=tree[2*node].ff, tree[node].ss=tree[2*node].ss;
        else
            tree[node].ff=tree[2*node+1].ff, tree[node].ss=tree[2*node+1].ss;
    }
}
void update(int node,int start,int end,int idx,int val){
    if(start==end){
        a[idx]=val;
        tree[node].ff=val;
    }
    else{
        int mid=(start+end)/2;
        if(idx>=start&&idx<=mid)        update(2*node,start,mid,idx,val);
        else                            update(2*node+1,mid+1,end,idx,val);
        if(tree[2*node]>tree[2*node+1])
            tree[node].ff=tree[2*node].ff, tree[node].ss=tree[2*node].ss;
        else
            tree[node].ff=tree[2*node+1].ff, tree[node].ss=tree[2*node+1].ss;
    }
}
pair<int, int> query(int node,int start,int end,int l,int r){
    if((l>end) || (start>r))    return {-1000000005,100005};
    if((l<=start) && (r>=end))    return tree[node];
    pair<int, int> p1,p2;
    int mid=(start+end)/2;
    p1=query(2*node,start,mid,l,r);
    p2=query(2*node+1,mid+1,end,l,r);
    if(p1.ff>p2.ff)         return p1;
    else                    return p2;
}

signed main()
{
	int n;
	cin>>n;
	maxx = (1 << n);

	for(int i = 1; i <= maxx; i++){
        cin>>a[i];
        //update(1, 1, maxx, i, a[i]);
	}
	build(1, 1, maxx);
	auto q1 = query(1, 1, maxx, 1, maxx/2), q2 = query(1, 1, maxx, maxx/2 + 1, maxx);
    if(q1.first > q2.first) cout<<q2.second;
    else                    cout<<q1.second;


	return 0;
}
