#include <bits/stdc++.h>
int main() {
  int size2, val, n, m, i, j, k, size = 0, a, b;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    val = 4;
    scanf("%d%d", &a, &b);
    size2 = a + 1;
    while (b > val) {
      size2++;
      val = val << 2;
    }
    if (size2 > size) size = size2;
  }
  printf("%d\n", size);
  return 0;
}
