#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  pair<int, int> *pr = new pair<int, int>[n];
  for (int i = 0; i < n; i++) cin >> pr[i].first >> pr[i].second;
  sort(pr, pr + n);
  for (int i = 0; i < n - 1; i++) {
    int power = pr[i + 1].first - pr[i].first;
    if (power < 14) {
      int s = pow(4.0, power) + 0.0001;
      pr[i + 1].second =
          max(pr[i].second / s + (pr[i].second % s != 0), pr[i + 1].second);
    }
  }
  int k = pr[n - 1].first;
  int del = pr[n - 1].second;
  int ptr = 1;
  if (del == 1) k++;
  while (ptr < del) ptr *= 4, k++;
  cout << k << endl;
  return 0;
}
