#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const int inf = (int)1e9;
const double inf1 = 1e-9;
const int ss = (int)1e6 + 3;
const int base = inf;
bool pred1(const pair<int, int>& i, const pair<int, int>& j) {
  if (i.first == j.first)
    return i.second > j.second;
  else
    return i.first > j.first;
}
int main() {
  int n;
  scanf("%d", &n);
  vector<pair<int, int> > a(n);
  for (int i = 0; i < n; ++i) scanf("%d%d", &a[i].first, &a[i].second);
  long long int res = 0;
  for (int i = 0; i < n; ++i) {
    long long int k = 1;
    long long int kol = 0;
    while (k < a[i].second) {
      k *= 4;
      ++kol;
    }
    if (kol == 0) kol = 1;
    res = max(res, kol + a[i].first);
  }
  cout << res;
  return 0;
}
