#include <bits/stdc++.h>
using namespace std;
long long int highestPowerof4(long long int n) {
  int res = 0;
  if (n == 0) return 1;
  while (n) {
    n /= 4;
    res++;
  }
  return res;
}
int main(void) {
  int n;
  vector<int> nr;
  vector<int> dim;
  long long int maxi = -1;
  cin >> n;
  for (int i = 0; i < n; i++) {
    long long int x, y;
    long long int k;
    k = 0;
    cin >> x >> y;
    dim.push_back(x);
    nr.push_back(y);
    k = highestPowerof4(y - 1) + x;
    maxi = max(maxi, k);
  }
  cout << maxi;
}
