#include <bits/stdc++.h>
using namespace std;
long long solve(long long k, long long a) {
  long long bound = 4LL;
  ++k;
  while (bound < a) {
    ++k;
    bound *= 4LL;
  }
  return k;
}
int main() {
  long long n, a, k, p = 0;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> k >> a;
    p = max(p, solve(k, a));
  }
  cout << p << endl;
  return 0;
}
