#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  size_t tmp, tmp1;
  cin >> n;
  vector<pair<size_t, double> > v(n);
  for (int i = 0; i < (n); i++) {
    cin >> tmp >> tmp1;
    v[i] = make_pair((tmp), (tmp1));
  }
  sort(v.begin(), v.end());
  tmp = v[n - 1].first;
  for (int i = 0; i < (n - 1); i++) {
    tmp1 = int(v[i].second / pow(4., (v[i + 1].first - v[i].first)) + 0.99);
    v[i + 1].second = tmp1 > v[i + 1].second ? tmp1 : v[i + 1].second;
  }
  while (v[n - 1].second > 1) {
    v[n - 1].second /= 4;
    v[n - 1].first++;
  }
  if (v[n - 1].first == tmp) v[n - 1].first++;
  cout << v[n - 1].first;
}
