#include <bits/stdc++.h>
using namespace std;
int n, ans;
int main() {
  while (~scanf("%d", &n)) {
    ans = 0;
    for (int i = 1; i <= n; i++) {
      int a, b;
      scanf("%d%d", &a, &b);
      int t = 0, cnt = 1;
      if (b == 1) a++;
      while (cnt < b) {
        cnt *= 4;
        a++;
      }
      ans = max(ans, a);
    }
    printf("%d\n", ans);
  }
}
