using System; using System.Collections.Generic; using System.IO; using System.Linq; class Solution { static void Main(String[] args) { int n = Convert.ToInt32(Console.ReadLine()); string[] a_temp = Console.ReadLine().Split(' '); int[] a = Array.ConvertAll(a_temp,Int32.Parse); Array.Sort(a); int max = 0; for (int i = 0; i < n-1; i++){ int count = 1; for (int j = i+1; j < n; j++){ int diff = a[j]-a[i]; if (diff > 1) break; count++; } max = Math.Max(max,count); } Console.WriteLine(max); } }