The first line contains an integer - the length of the sequence.The second line contains integers -
Output an integer - the length of the longest non-decreasing sequence after some operations.
6 5 1 6 2 3 4
5
In the test case, we can right shift 5 times.[5,1,6,2,3,4] -> [4,5,1,6,2,3] -> [3,4,5,1,6,2] -> [2,3,4,5,1,6] -> [6,2,3,4,5,1] -> [1,6,2,3,4,5] the length of longest non-decreasing sequence equals to 5.