
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.StreamTokenizer;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.TreeSet;
import java.lang.Integer;

public class boxes_kp_java {

    static StreamTokenizer st = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));

    static int nextInt() {
        try {
            st.nextToken();
            return (int) st.nval;
        } catch (IOException ex) {
            return 0;
        }
    }

    public static void main(String[] args) {
        int n = nextInt();
        int m = 0;
        int k, a;
        for (int i = 0; i < n; i++) {
            k = nextInt();
            a = nextInt();
            int tm = k + 1;
            if (a > 1) {
                int p = 0;
                int v = 1;
                while (v < a) {
                    v *= 4;
                    p++;
                }

                tm = p + k;
            }
            m = Math.max(m, tm);

        }
        System.out.println(m);
    }
}
