#include <bits/stdc++.h>
using namespace std;
struct node {
  int k;
  double a;
  bool operator<(const node& rhs) const { return k < rhs.k; }
} B[100010];
int n;
int main() {
  scanf("%d", &n);
  for (int i = (int)0; i <= (int)n - 1; ++i) {
    int _a, k;
    scanf("%d%d", &k, &_a);
    B[i].k = k;
    B[i].a = log(_a) / log(2);
  }
  sort(B, B + n);
  for (int i = (int)0; i <= (int)n - 1 - 1; ++i)
    B[i + 1].a = max(B[i + 1].a, B[i].a - 2.0 * (B[i + 1].k - B[i].k));
  int res = B[n - 1].k + 1;
  while (B[n - 1].a - 2.0 * (res - B[n - 1].k) > 0) ++res;
  printf("%d", res);
}
