#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  pair<unsigned int, unsigned int> p[100100];
  cin >> n;
  for (int i = 0; i < n; i++) cin >> p[i].first >> p[i].second;
  sort(p, p + n);
  for (int i = 1; i < n; i++) {
    if (p[i].first - p[i - 1].first > 15)
      continue;
    else {
      unsigned int tmp = 1U << 2 * (p[i].first - p[i - 1].first);
      p[i].second = max(p[i].second, (p[i - 1].second + tmp - 1) / tmp);
    }
  }
  for (int i = 2; i <= 30; i += 2) {
    if (p[n - 1].second <= 1U << i) {
      cout << p[n - 1].first + i / 2 << endl;
      return 0;
    }
  }
  cout << p[n - 1].first + 16 << endl;
}
