#include <bits/stdc++.h>
using namespace std;
int n, bruh;
long long k, a, c, p;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> k >> a;
    c = 4;
    for (int i = 1; i < 69; i++) {
      if (c >= a) {
        bruh = i;
        break;
      }
      c *= 4;
    }
    p = max(p, bruh + k);
  }
  cout << p;
}
