#include <bits/stdc++.h>
using namespace std;
int n, m, x, y, res = 0;
pair<int, int> a[100005];
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    scanf("%d%d", &x, &y);
    a[i] = make_pair(x, y);
  }
  sort(a, a + n);
  for (int i = 0; i < n; ++i) {
    int y = 1, r = 0;
    m = a[i].second;
    while (1) {
      y *= 4;
      ++r;
      if (y >= m) break;
    }
    res = max(a[i].first + r, res);
  }
  cout << res;
  return 0;
}
