#include <bits/stdc++.h>
using namespace std;
int n, maxx = 0;
int x, y;
double res = 0;
int main() {
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    scanf("%d%d", &x, &y);
    double tmp = (double)x * log(2) + log((double)y) / 2;
    res = max(res, tmp);
    maxx = max(maxx, x);
  }
  res /= log(2);
  int u = (int)res;
  if (abs(res - u) >= 1e-9) u++;
  cout << max(u, maxx + 1) << endl;
  return 0;
}
