4. Rice Length
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

In one of the restaurants, a dispute arose among $$$n$$$ chefs: what should the length of rice be? Each chef has their own opinion: the $$$i$$$-th chef believes that the length should be $$$h_i$$$ millimeters.

A chef can convince another chef if their opinions about the rice length differ by one (that is, the $$$i$$$-th chef can convince the $$$j$$$-th one if $$$|h_i - h_j| = 1$$$). If the $$$i$$$-th chef convinces the $$$j$$$-th chef, then the value of $$$h_j$$$ becomes equal to the value of $$$h_i$$$. A convinced chef may then change their opinion again.

The restaurant's purchasing manager needs to buy rice of one length. Determine the maximum number of chefs that can be satisfied after some chefs may convince each other (in other words — the largest number of chefs who can come to a common opinion about the rice length).

Input

The first line of the input contains one natural number $$$n$$$ ($$$1 \leqslant n \leqslant 10^5$$$) — the number of chefs.

Each of the next $$$n$$$ lines contains one natural number $$$h_i$$$ ($$$1 \leqslant h_i \leqslant 10^9$$$) — the ideal rice length according to the $$$i$$$-th chef.

Output

The program should output one number — the maximum number of chefs who can come to a common opinion about the rice length.

Scoring

Solutions that work correctly when $$$n \leqslant 10^3$$$ and all $$$h_i$$$ are distinct will be awarded 20 points.

Solutions that work correctly when $$$n \leqslant 10^3$$$ will be awarded 60 points.

Example
Input
7
2
3
4
2
6
8
7
Output
4
Note

In the sample from the statement, the chefs have the following preferences for rice length: 2, 3, 4, 2, 6, 8, 7. First, the second chef will convince the third one that the rice length should be 3. Then the first chef will convince the second and third ones that 2 is a suitable length. Also, the fourth chef believes that 2 is a suitable length, so 4 chefs agreed that length 2 is suitable.