#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
const double PI = acos(-1.0);
const int EPS = (1e-10);
const int N = 1e5 * 2 + 10;
const int inf = 1e9 * 2 + 10;
const ll INF = 1e18 * 2 + 10;
const int MOD = 1e9 + 7;
int nxt() {
  int x;
  cin >> x;
  return x;
}
int fcmp(double a, double b) {
  return (fabs(a - b) < EPS ? 0 : a > b ? 1 : -1);
}
int n;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n;
  int mx = 0, p = 0;
  for (int i = (1); i <= (n); ++i) {
    int k, a;
    cin >> k >> a;
    mx = max(mx, k);
    ll s = 1;
    int m = 0;
    while (s < a) {
      s *= 4;
      m++;
    }
    p = max(p, k + m);
  }
  if (mx == p) p++;
  cout << p;
  return 0;
}
