#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100001;
pair<int, int> cajas[MAXN];
int main() {
  int n, res = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> cajas[i].first >> cajas[i].second;
  }
  for (int i = 0; i < n; i++) {
    if (cajas[i].second == 1) {
      cajas[i].second++;
    }
    cajas[i].second--;
    while (cajas[i].second > 0) {
      cajas[i].second = (cajas[i].second) / 4;
      cajas[i].first++;
    }
    res = max(res, cajas[i].first);
  }
  cout << res;
}
