#include <bits/stdc++.h>
using namespace std;
bool vis[100009];
int l[100009];
int ans = -1;
int main() {
  int n, length, cnt;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &length, &cnt);
    while (cnt > 1) {
      cnt = ceil(cnt / 4.0);
      length++;
      vis[i] = true;
    }
    l[i] = length;
  }
  for (int i = 0; i < n; i++) {
    ans = max(ans, l[i]);
    if (!vis[i]) ans = max(ans, l[i] + 1);
  }
  printf("%d\n", ans);
}
