#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <cmath>
using namespace std;
const int N = 100010;
typedef long long LL;
LL imax = -1e18;
int a[N];
int n;
LL cnt;
int main()
{
scanf("%d",&n);
for(int i = 1;i <= n;i++)
{
scanf("%d",&a[i]);
}
for(int d = 1,i = 1;i <= n;d++,i *= 2)
{
LL res = 0;
for(int j = i;j < i + (1 << (d - 1)) && j <= n;j++)
{
res += a[j];
}
if(res > imax)
{
imax = res;
cnt = d;
}
}
cout << cnt << endl;
return 0;
}