#include <bits/stdc++.h>
using namespace std;
int dx[] = {-1, 0, 1, 0, -1, 1, 1, -1}, dy[] = {0, -1, 0, 1, -1, -1, 1, 1};
int kx[] = {2, 1, -1, -2, -2, -1, 1, 2}, ky[] = {1, 2, 2, 1, -1, -2, -2, -1};
string toString(int n) {
  stringstream ss;
  ss << n;
  return ss.str();
}
int toInt(string s) {
  int r = 0;
  istringstream sin(s);
  sin >> r;
  return r;
}
int POW(int b, int p) {
  int r = 1;
  for (int i = 1; i <= p; i++) r *= b;
  return r;
}
bool isVowel(char ch) {
  ch = tolower(ch);
  return ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u';
}
int bigmod(long long B, long long P, long long M) {
  long long R = 1;
  while (P > 0) {
    if (P % 2 == 1) {
      R = (R * B) % M;
    }
    P /= 2;
    B = (B * B) % M;
  }
  return (int)R;
}
long long nCr(double n, double r) {
  double ans = 1;
  if (r > n - r) r = n - r;
  for (int i = 1; i <= r; i++) {
    ans *= (n - i + 1);
    ans /= i;
  }
  return (long long)ans;
}
int main() {
  int n, m;
  scanf("%d", &n);
  double res = -1;
  for (int i = 0; i < n; i++) {
    double a, b;
    scanf("%lf%lf", &a, &b);
    if (res < (2 * a) + log2(b) || (res == (2 * a) + log2(b) && b == 1)) {
      res = (2 * a) + log2(b);
      m = b;
    }
  }
  long long ret = (int)(ceil(res));
  if (ret % 2) ret++;
  ret /= 2;
  if (m == 1) ret++;
  printf("%d\n", ret);
  return 0;
}
