#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
const long double PI = acos(-1.0);
const double eps = 1e-12;
const int INF = 2147483647;
const long long LLINF = 9223372036854775807LL;
int main() {
  int n;
  double ln = log(4.);
  while (scanf("%d", &n) == 1) {
    int maxVal = 0;
    for (int i = 0; i < n; i++) {
      int k, a, t;
      scanf("%d%d", &k, &a);
      if (a != 1)
        t = k + ceil(log(a + 0.) / ln);
      else
        t = k + 1;
      maxVal = max(maxVal, t);
    }
    printf("%d\n", maxVal);
  }
  return 0;
}
