#include <bits/stdc++.h>
using namespace std;
using namespace std;
int n, a, b, ans;
int main() {
  cin >> n;
  while (n--) {
    cin >> a >> b;
    a++, b--;
    while (b /= 4) a++;
    ans = max(ans, a);
  }
  cout << ans;
}
