#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > v;
int main(int argc, char** argv) {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    v.push_back(make_pair(x, y));
  }
  sort(v.begin(), v.end());
  for (int i = 1; i < v.size(); i++) {
    int diff = v[i].first - v[i - 1].first;
    int tmp = 1;
    if (2 * diff <= 30) {
      int zn = (1 << (2 * diff));
      tmp = v[i - 1].second / zn;
      if (v[i - 1].second % zn) tmp++;
    }
    v[i].second = max(v[i].second, tmp);
  }
  int ans = v.back().first + 1;
  int res = v.back().second;
  while (res > 4) {
    ans++;
    int tmp = res / 4;
    if (res % 4) tmp++;
    res = tmp;
  }
  printf("%d\n", ans);
  return 0;
}
