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