#include <bits/stdc++.h>
using namespace std;
int max(int a, int b) { return a > b ? a : b; }
int main() {
  int n;
  int ans = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int k, a;
    scanf("%d %d", &k, &a);
    long long p = 4;
    int c = 1;
    while (p < a) {
      p *= 4;
      c++;
    }
    ans = max(ans, k + c);
  }
  printf("%d\n", ans);
}
