#include <bits/stdc++.h>
using namespace std;
int sqrt2[32];
void fun() {
  sqrt2[0] = 1;
  for (int i = 1; i < 31; i++) sqrt2[i] = sqrt2[i - 1] * 2;
}
map<int, int> box;
int n;
int main() {
  fun();
  box.clear();
  scanf("%d", &n);
  int m, k;
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &k, &m);
    box[k] = m;
  }
  map<int, int>::iterator it, is;
  it = is = box.begin();
  it++;
  for (; it != box.end(); it++, is++) {
    if (it->first - is->first <= 15) {
      if (ceil((double)is->second /
               (sqrt2[it->first - is->first] * sqrt2[it->first - is->first])) >
          it->second)
        it->second = ceil((double)is->second / (sqrt2[it->first - is->first] *
                                                sqrt2[it->first - is->first]));
    }
  }
  it--;
  int cnt = it->first;
  if (it->second == 1) {
    printf("%d\n", cnt + 1);
    return 0;
  }
  cnt += ceil(log(it->second * 1.0) / log(4.0));
  printf("%d\n", cnt);
  return 0;
}
