#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
long long arr[20];
int main()
{
int n;
scanf("%d", &n);
for (int i = 1; i <= n; ++i)
{
int tmp;
scanf("%d", &tmp);
int level = log2(i);
// cout << level << endl;
arr[level] += tmp;
}
int maxv = 0;
for (int i = 1; i <= log2(n); ++i)
{
// cout << arr[i] << endl;
if (arr[i] > arr[maxv])
maxv = i;
}
printf("%d", maxv+1);
return 0;
}