#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  long long N, p = 0, k, v, mx = 0;
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> k >> v;
    mx = max(mx, k);
    int pd = 0, s = 1;
    while (s < v) s *= 4, pd++;
    p = max(p, pd + k);
  }
  if (p == mx) p++;
  cout << p << "\n";
  return 0;
}
