#include <bits/stdc++.h>
using namespace std;
int n;
unsigned int k, a;
long long resul = 0;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> k;
    cin >> a;
    unsigned int temp;
    for (int p = 1; p < 16; p++) {
      temp = 1 << 2 * p;
      if (temp >= a) {
        temp = p + k;
        break;
      }
    }
    if (temp > resul) {
      resul = temp;
    }
  }
  cout << resul;
  return 0;
}
