#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 1;
int n;
pair<int, int> a[N];
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i].first >> a[i].second;
  sort(a + 1, a + n + 1);
  for (int i = 1; i < n; ++i) {
    int k = a[i + 1].first - a[i].first;
    if (2 * k >= 30) continue;
    a[i + 1].second =
        max(a[i + 1].second, (int)ceil(a[i].second * 1.0 / pow(2, 2 * k)));
  }
  int k = max((int)ceil(log2(a[n].second) / 2), 1);
  cout << a[n].first + k;
}
