#include <bits/stdc++.h>
int main() {
  int t;
  scanf("%d", &t);
  int a, b, tmp, max = 0, ca;
  for (int i = 0; i < t; i++) {
    scanf("%d%d", &a, &b);
    ca = 1;
    tmp = a;
    while (ca < b) {
      ca *= 4;
      tmp++;
    }
    if (b == 1 || b == 2 || b == 3 || b == 4) tmp = a + 1;
    if (tmp > max) max = tmp;
  }
  printf("%d\n", max);
  return 0;
}
