#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 30;
const double EPS = 1e-7;
int getlog2(int k) {
  int ans = 0;
  long long v = 1;
  while (v < k) {
    v *= 2;
    ans += 1;
  }
  return ans;
}
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int p = 0;
  for (int i = 0; i < n; i++) {
    int size, cant;
    cin >> size >> cant;
    int l = getlog2(cant);
    int p1 = size + (l + 1) / 2;
    if (l == 0) p1++;
    p = max(p, p1);
  }
  cout << p << endl;
  return 0;
}
