#include <bits/stdc++.h>
using namespace std;
const int inf = 2147483647;
int main() {
  long long j, i, n, ki, ai, ans = 0;
  cin >> n;
  for (i = 1; i <= n; ++i) {
    cin >> ki >> ai;
    for (j = 1; j * j < ai; j *= 2) ki++;
    if (ai == 1) ki++;
    ans = max(ans, ki);
  }
  cout << ans << endl;
}
