#include <bits/stdc++.h>
using namespace std;
const int INF = int(1e9 + 7);
const int MOD = int(1e9 + 7);
template <typename T, typename U>
inline void AMIN(T &x, U y) {
  if (x > y) x = y;
}
template <typename T, typename U>
inline void AMAX(T &x, U y) {
  if (x < y) x = y;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  long long ans = 0;
  for (int i = 0; i < int(n); i++) {
    long long k, a, four = 1, tmp = 0;
    cin >> k >> a;
    while (1) {
      tmp++;
      four *= 4;
      if (four >= a) break;
    }
    ans = max(ans, k + tmp);
  }
  cout << ans << endl;
  return 0;
}
