#include <bits/stdc++.h>
using namespace std;
int ans, n, k, a, t;
int main() {
  ans = 0;
  scanf("%d", &n);
  while (n--) {
    scanf("%d%d", &k, &a);
    ans = max(ans, k + 1);
    for (t = 1; t < a; t <<= 2) k++;
    ans = max(ans, k);
  }
  printf("%d", ans);
}
