#include <bits/stdc++.h>
using namespace std;
const int N = 1E6 + 10;
long long a[N];
int n;
int main() {
  a[0] = 1;
  for (int i = 1; i <= 30; i++) a[i] = (long long)4 * a[i - 1];
  cin >> n;
  long long ans = 1;
  for (int i = 1; i <= n; i++) {
    long long t, b;
    cin >> t >> b;
    if (b == 1) t++;
    int u = lower_bound(a, a + 31, b) - a;
    ans = max(ans, u + t);
  }
  cout << ans << endl;
  return 0;
}
