#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int maxk = 0, ret = 0;
  for (int i = 0; i < n; i++) {
    int k, a;
    cin >> k >> a;
    maxk = max(k, maxk);
    int m = 0, s = 1;
    while (s < a) s *= 4, m++;
    ret = max(ret, k + m);
  }
  if (ret == maxk) ret++;
  cout << ret << endl;
  return 0;
}
