You are given an array A with N elements. You create a graph G with N vertices using A as follows:
For any pair of indices (i, j) where 1≤i<j≤N, if A[i]>A[j], then add an undirected edge between vertices i and j.
In graph G, find the maximum possible size of set S (of vertices in G) such that there exists an edge between every pair of vertices that are available in S.
Input format
Output format
Among all the vertices available in S, find the maximum possible size of S.
Constraints
1≤N≤105
1≤A[i]≤106
G will have 3 vertices and following edges : 1 - 2
S = {1, 2 } , |S| = 2 is optimal choice.