The highlight of a roller coaster is the moment the train runs down a slope and climbs back up. Yeongchang designs roller coasters and wants that highlight stretch to be as long as possible.
Building a new coaster costs too much, so Yeongchang bought a used one that is down to its steel columns. The stretch he plans to remodel holds N columns in a row, and the height of each column is given as a number. Moving a column is expensive, so he only removes columns, and the columns that stay keep their original order.
List the heights of the remaining columns in order. They form a highlight stretch when the heights first keep falling and then keep rising. The slope has to stay smooth, so two neighboring columns cannot have the same height. The rising part may be missing, and the travel direction is decided after the work ends, so a stretch that only falls and a stretch that only rises count the same. When no highlight stretch is possible at all, only the single tallest column stays.
For example, with heights 4 3 5 1 4 2 3, the best choice removes the third column of height 5 and the fifth column of height 4, which leaves 4 3 1 2 3 and keeps 5 columns.
Write a program that computes the largest number of columns that can stay.