Cappuccino Assassino
Cappuccino Assassino is playing with his new friend, Ballerina Cappuccina, and they have found some dominos to play with. The dominos have various sizes, and they have been lined up in some order standing up. Assassino is interested in how they will behave if he knocks over one of them. He says that any knocked over domino will surely trigger the rest of them to fall over. Ballerina chides him; obviously a domino can only knock over a strictly smaller domino and over time, they will lose energy due to factors such as friction.
You are given the sizes and order of the dominos. We can pick a single domino to knock over. When knocked over, each domino will knock over the next domino in front of it if its size is strictly greater than the previous one. Assassino and Ballerina start by knocking over the domino which will cause maximum number of dominos to fall by the end of the chain reaction. What is the length of the streak of dominos?
Input
The first line contains a single integer
, the number of dominos which have been lined up. The dominos are labelled
through
.
The next line contains space-separated integers
, the size of each of the
dominos.
Output
Output the longest streak of dominos.
Example
Input 1
13
5 4 3 2 2 1 9 8 7 6 4 4 1
Output 1
5
5 is the longest streak (9 - 8 - 7 - 6 - 4)
Input 2
3
99 100 101
Output 2
1
Comments