#include <bits/stdc++.h>
using namespace std;
int n, x, y, m;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &x, &y);
    if (y == 1)
      x++;
    else
      for (int t = 1; t < y; t <<= 2) x++;
    m = max(m, x);
  }
  printf("%d\n", m);
}
