#include <bits/stdc++.h>
using namespace std;
int n, temp, ans, m;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &temp, &ans);
    if (ans == 1)
      temp++;
    else
      for (int t = 1; t < ans; t <<= 2) temp++;
    m = max(m, temp);
  }
  printf("%d\n", m);
}
