#include <bits/stdc++.h>
using namespace std;
int isPowerOfTwo(unsigned int x) { return ((x != 0) && !(x & (x - 1))); }
int main() {
  int N;
  cin >> N;
  int maxSide = 0;
  for (int i = 0; i < N; i++) {
    int k, a;
    cin >> k >> a;
    maxSide =
        max(maxSide, (a == 1 ? 1 : 0) + k + (int)ceil(log2(ceil(sqrt(a)))));
  }
  cout << maxSide << endl;
  return 0;
}
