#include <bits/stdc++.h>   using namespace std;   int main() {     int n;     cin >> n;     int result = 0;     for (int i = 0; i < n; i++) {       int k, a;       cin >> k >> a;       long x = k * a;       int c = 0;       if (a % 4 == 0) a--;       while (a) {         a /= 4;         c++;       }       result = (((result) < (k + c)) ? (k + c) : (result));     }     cout << result;   }   