# include <stdio.h>
int main()
{
int n, t, a[10000]= {0}, times = 1, max = 0;
scanf("%d", &n);
for(int i = 0; i < n; i++)
scanf("%d", &a[i]);
for(int i = 0; i < n-1; i++)
for(int j = 0; j < n-i-1; j++)
if(a[j] > a[j+1])
{
t = a[j];
a[j] = a[j+1];
a[j+1] = t;
}
for(int i = 1; i < n; i++)
{
if(a[i] == a[i-1])continue;
if(a[i] == a[i-1]+1)
times++;
if(times > max)
max = times;
else if(a[i] > a[i-1])
times = 1;
}
printf("%d", max);
return 0;
}```