#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  long long int a, b, i;
  long long int maxans = 0, ans;
  for (i = 0; i < n; i++) {
    cin >> a >> b;
    ans = ceil(log(b) / log(4));
    if (ans == 0) ans = 1;
    ans += a;
    maxans = max(maxans, ans);
  }
  cout << maxans << endl;
  return 0;
}
