#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const double EPS = 1e-9;
const int ioo = (~0) - (1 << 31);
const long long loo = (~(long long)0) - ((long long)1 << 63);
typedef struct node {
  int x;
  int y;
} node;
node a[100005];
inline bool cmp(node x1, node y1) { return x1.x < y1.x; }
int n;
int num(int n1, int k) {
  int tmp = n1;
  int len = 0;
  while (tmp > 0) {
    len++;
    tmp >>= 1;
  }
  len--;
  if (2 * k > len)
    return 1;
  else {
    if (n1 % (1 << (2 * k)) == 0)
      return n1 >> (2 * k);
    else
      return (n1 >> (2 * k)) + 1;
  }
}
int main() {
  while (scanf("%d", &n) == 1) {
    for (int i = 1; i <= n; i++) {
      scanf("%d %d", &a[i].x, &a[i].y);
    }
    sort(a + 1, a + 1 + n, cmp);
    for (int i = 1; i < n; i++)
      a[i + 1].y = max(a[i + 1].y, num(a[i].y, a[i + 1].x - a[i].x));
    long long tmp = (long long)1;
    int ans = 0;
    while (tmp > 0) {
      ans++;
      tmp *= (long long)4;
      if (tmp >= (long long)a[n].y) break;
    }
    printf("%d\n", ans + a[n].x);
  }
  return (0);
}
