410024: GYM103920 B Anya's Rocks
Description
Anya has a row of $$$N$$$ rocks that are each painted one of $$$C$$$ possible colors. Although Anya likes all kinds of rocks, she will throw a fit if two adjacent rocks have the same color. She wants to select the longest possible contiguous subsequence of rocks in the row such that no two adjacent rocks have the same color. Can you help our heroine find the longest segment with this property?
InputThe first line contains two integers $$$N$$$ and $$$C$$$ ($$$1 \leq N, C \leq 100$$$), representing the number of rocks and the number of colors, respectively. The next line contains $$$N$$$ space-separated integers $$$c_i$$$ ($$$1 \leq c_i \leq C$$$) which denote the colors of the rocks along the row.
OutputOutput a single integer representing the maximum number of rocks on the segment having no two adjacent rocks with the same color.
ExampleInput8 5 4 4 1 2 3 3 5 1Output
4Note
We can select contiguous subsequence [4 1 2 3] in the sample test case.