#include <bits/stdc++.h>
using namespace std;
int n, i, k, l;
pair<long, long> a[100005];
double w, q;
long long sum, w1, max1, max2, res;
int main() {
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%d%d", &a[i].first, &a[i].second);
  sort(a, a + n);
  reverse(a, a + n);
  max1 = a[0].first + 1;
  for (i = 0; i < n; i++) {
    q = max1 - a[i].first;
    if (q > 16) continue;
    w = pow(4.0, q);
    w1 = w;
    res = max1;
    while (a[i].second > w1) {
      w1 *= 4;
      res++;
    }
    if (res > max2) max2 = res;
  }
  if (max2 == 0) max2 = max1;
  cout << max2 << endl;
}
