#include <bits/stdc++.h>
int x4[4] = {0, 0, -1, 1};
int y4[4] = {-1, 1, 0, 0};
int x8[8] = {-1, -1, -1, 0, 0, 1, 1, 1};
int y8[8] = {-1, 0, 1, -1, 1, -1, 0, 1};
using namespace std;
int n;
int k, a;
int ans;
int cur;
int main() {
  ans = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d %d", &k, &a);
    cur = k + 1;
    a = ceil(a / 4.0);
    while (a > 1) {
      cur++;
      a = ceil(a / 4.0);
    }
    ans = max(ans, cur);
  }
  printf("%d\n", ans);
  return 0;
}
