Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

No tag edit access

M. The Pleasant Walk

time limit per test

1 secondmemory limit per test

512 megabytesinput

standard inputoutput

standard outputThere are $$$n$$$ houses along the road where Anya lives, each one is painted in one of $$$k$$$ possible colors.

Anya likes walking along this road, but she doesn't like when two adjacent houses at the road have the same color. She wants to select a long segment of the road such that no two adjacent houses have the same color.

Help Anya find the longest segment with this property.

Input

The first line contains two integers $$$n$$$ and $$$k$$$ — the number of houses and the number of colors ($$$1 \le n \le 100\,000$$$, $$$1 \le k \le 100\,000$$$).

The next line contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the colors of the houses along the road ($$$1 \le a_i \le k$$$).

Output

Output a single integer — the maximum number of houses on the road segment having no two adjacent houses of the same color.

Example

Input

8 3 1 2 3 3 2 1 2 2

Output

4

Note

In the example, the longest segment without neighboring houses of the same color is from the house 4 to the house 7. The colors of the houses are $$$[3, 2, 1, 2]$$$ and its length is 4 houses.

Codeforces (c) Copyright 2010-2020 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Jan/29/2020 19:14:59 (h1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|