#include <bits/stdc++.h>
using namespace std;
int main() {
  long long ans = 0, k, a;
  int n;
  cin >> n;
  for (int i = 0; i <= n - 1; i++) {
    cin >> k >> a;
    long long x = ceil((log2(a)) / 2.0);
    if (x == 0)
      ans = ((ans) > (k + 1) ? (ans) : (k + 1));
    else
      ans = ((ans) > (x + k) ? (ans) : (x + k));
  }
  if (ans == 0)
    cout << "1";
  else
    cout << ans << endl;
  return 0;
}
