Problems

# Picking Numbers

# Picking Numbers

Given an array of integers, find and print the maximum number of integers you can select from the array such that the absolute difference between any two of the chosen integers is less or equal to **1**.

#### Input

The first line contains a single integer **n** (**2** ≤ **n** ≤ **100**), denoting the size of the array. The second line contains **n** integers describing the respective values of `a`

, _{0}`a`

, ..., _{1}`a`

(_{n-1}**0** < `a`

< _{i}**100**).

#### Output

Print a single integer denoting the maximum number of integers you can choose from the array such that the absolute difference between any two of the chosen integers is ≤ **1**. The answer is ≥ **2**.

Input example #1

6 4 6 5 3 3 1

Output example #1

3

Input example #2

6 1 2 2 3 1 2

Output example #2

5