#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  long long a, b, ans = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%I64d %I64d", &a, &b);
    if (b == 1 && a + 1 > ans) ans = a + 1;
    while (b > 1) {
      a++;
      b = (b + 3) >> 2;
    }
    if (a > ans) ans = a;
  }
  printf("%I64d\n", ans);
  return 0;
}
