#include <bits/stdc++.h>
const int SIZE_N = 100000 + 10;
int n;
int k[SIZE_N], a[SIZE_N];
int main(void) {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d%d", k + i, a + i);
  long long ans = 0;
  int mk = -1, ma;
  for (int i = 0; i < n; ++i) {
    long long temp = 0;
    for (; (1LL << temp + temp) < a[i]; ++temp)
      ;
    ans = std::max(ans, temp + k[i]);
    if (mk < k[i]) mk = k[i], ma = a[i];
  }
  if (ma == 1) {
    if (ans == mk)
      printf("%d\n", mk + 1);
    else
      printf("%I64d\n", ans);
  } else {
    printf("%I64d\n", ans);
  }
  return 0;
}
