#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  int k, t;
  cin >> n;
  int s = 0;
  while (n--) {
    cin >> k >> t;
    if (s < k + 1) s = k + 1;
    t--;
    while (t) {
      k++;
      t /= 4;
    }
    if (k > s) s = k;
  }
  cout << s << endl;
}
