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