#include <bits/stdc++.h>
using namespace std;
int get(int a) {
  int ret = 0;
  long long r = 1;
  while (r < a) {
    r <<= 2;
    ++ret;
  }
  return ret;
}
int n;
int k, a;
int ans;
int main() {
  scanf("%d", &n);
  for (int r, i = 0; i < n; ++i) {
    scanf("%d%d", &k, &a);
    r = get(a);
    ans = max(ans, r + !r + k);
  }
  printf("%d", ans);
  return 0;
}
