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