#include <bits/stdc++.h>
using namespace std;
int const MAXN = 100100;
struct pp {
  int deg, cnt;
} s[MAXN];
int main() {
  int n;
  scanf("%d", &n);
  int ind = -1;
  int mx_deg = -1;
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &s[i].deg, &s[i].cnt);
    if (s[i].deg > mx_deg) {
      mx_deg = s[i].deg;
      ind = i;
    }
  }
  long long mx = 0;
  for (int i = 0; i < n; i++) {
    long long deg = s[i].deg;
    long long cnt = s[i].cnt;
    long long cur_cnt = 4;
    long long Q = deg + 1;
    for (; cur_cnt < cnt; Q++, cur_cnt *= 4)
      ;
    mx = max(mx, Q);
  }
  cout << mx;
  return 0;
}
