#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int p = 0;
  int maxk = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int a, k;
    cin >> k >> a;
    maxk = max(maxk, k);
    int maxp = 0;
    int count = 1;
    while (a > count) {
      count *= 4;
      maxp++;
    }
    p = max(p, k + maxp);
  }
  if (p == maxk) {
    p++;
  }
  cout << p;
  return EXIT_SUCCESS;
}
