#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ans = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int size, num;
    cin >> size >> num;
    int z = 0, p = 1;
    do {
      p = p * 4;
      z++;
    } while (p < num);
    ans = max(ans, size + z);
  }
  cout << ans << endl;
}
