#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ans, k, a;
  while (scanf("%d", &n) == 1) {
    ans = 1;
    for (int i = 0; i < n; ++i) {
      scanf("%d%d", &k, &a);
      if (a == 1) k++;
      ans = max(ans, k + (int)ceil(log((double)a) / log(4.0)));
    }
    printf("%d\n", ans);
  }
  return 0;
}
