#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int ans = -1;
  for (int i = 0; i < n; i++) {
    int k, a;
    cin >> k >> a;
    int p = log(a) / log(4);
    if ((int)pow(4, p) < a) {
      p++;
    }
    if (p == 0) {
      p++;
    }
    if (k + p > ans) {
      ans = k + p;
    }
  }
  cout << ans << endl;
  return 0;
}
