#include <iostream>
#include <cmath>
using namespace std;
int n, a, ans, mx = -1000000;
long long sum;
int main(){
scanf("%d", &n);
for(int dep = 1, cnt = 1; cnt <= n; dep ++){ //按深度来遍历
for(int i = 1; i <= pow(2, dep - 1) && cnt <= n; cnt ++, i ++){
scanf("%d", &a);
sum += a;
}
if(sum > mx){
mx = sum;
ans = dep;
}
sum = 0;
}
printf("%d", ans);
return 0;
}