You are given n boxes and each box contains two small boxes of Red and Blue color. The size of the Red and Blue colored boxes are bi and ri respectively.
Consider a sequence of distinct integers x1,x2,…,xk (1≤xi≤n).
Consider x to be a suitable sequence if, for every 1≤i<k holds bxi<rxi+1 and rxi<bxi+1.
Determine the maximum possible size of the suitable sequence.
Input format
Output format
Print only one integer representing the size of the maximum suitable sequence.
sequence [1,3] is suitable since b1<r3 and r1<b3. Its size is 2 and it can be shown that we can't arrange all 3 girls to form a suitable sequence of size 3.