#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long int r = -10;
  for (int i = 0; i < n; i++) {
    long long int k, a;
    cin >> k >> a;
    do {
      k++;
      if (a % 4 > 0)
        a = a / 4 + 1;
      else
        a /= 4;
    } while (a > 1);
    r = max(r, k);
  }
  cout << r << endl;
  return 0;
}
