#include <bits/stdc++.h>
int N, R, K, A;
int main() {
  std::cin >> N;
  while (N--) {
    std::cin >> K >> A;
    A = ceil(log2(A) / 2);
    K += A ? A : 1;
    R = R < K ? K : R;
  }
  std::cout << R;
}
