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