#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long int a, b, maxi = 0, temp;
  for (int i = 0; i < n; i++) {
    cin >> a >> b;
    int c = 1;
    if (b == 1)
      a++;
    else {
      for (int j = 0; j >= 0; j++) {
        if (b > c) {
          a++;
          c = 4 * c;
        } else
          break;
      }
    }
    if (a > maxi) maxi = a;
  }
  cout << maxi;
  return 0;
}
