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