#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 10;
int n, cur = 1, lst, res;
pair<int, int> dat[MAXN];
long long pre[100], mx;
bool cmp(pair<int, int> a, pair<int, int> b) { return a.first > b.first; }
int main() {
  pre[0] = 1;
  for (lst = 0; pre[lst] <= 1e9; lst++) pre[lst + 1] = pre[lst] * 4;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d%d", &dat[i].first, &dat[i].second);
  sort(dat + 1, dat + n + 1, cmp);
  mx = dat[1].second;
  for (int i = 2; i <= n; i++) {
    int tmp = dat[1].first - dat[i].first;
    if (tmp > lst)
      break;
    else
      mx = max(mx, dat[i].second / pre[tmp] + (dat[i].second % pre[tmp] != 0));
  }
  if (mx == 1) return printf("%d", dat[1].first + 1), 0;
  for (int i = 1; i <= lst; i++)
    if (pre[i] >= mx) return printf("%d", dat[1].first + i), 0;
  return 0;
}
