#arc082a. [arc082_a]Together

[arc082_a]Together

Problem Statement

You are given an integer sequence of length NN, a1,a2,...,aNa_1,a_2,...,a_N.

For each 1iN1≤i≤N, you have three choices: add 11 to aia_i, subtract 11 from aia_i or do nothing.

After these operations, you select an integer XX and count the number of ii such that ai=Xa_i=X.

Maximize this count by making optimal choices.

Constraints

  • 1N1051≤N≤10^5
  • 0ai<105(1iN)0≤a_i<10^5 (1≤i≤N)
  • aia_i is an integer.

Input

The input is given from Standard Input in the following format:

NN a1a_1 a2a_2 .. aNa_N

Output

Print the maximum possible number of ii such that ai=Xa_i=X.


Sample Input 1

7
3 1 4 1 5 9 2

Sample Output 1

For example, turn the sequence into 2,2,3,2,6,9,22,2,3,2,6,9,2 and select X=2X=2 to obtain 44, the maximum possible count.


Sample Input 2

10
0 1 2 3 4 5 6 7 8 9

Sample Output 2


Sample Input 3

1
99999

Sample Output 3