#include <bits/stdc++.h>
using namespace std;
const int INF = 2147483647;
const long long LLINF = 9223372036854775807LL;
int main() {
  int n;
  long long p = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int a, col;
    scanf("%d %d", &a, &col);
    int z = 1;
    while ((1ull << (z)) * (1ull << (z)) < (unsigned long long)col) z++;
    p = max(p, (long long)a + z);
  }
  cout << p << "\n";
  return 0;
}
