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