#!/bin/python import sys n = int(raw_input().strip()) a = map(int,raw_input().strip().split(' ')) counter=[0]*101 for x in a: counter[x]+=1 the_max=0 for i in xrange(100): the_num=counter[i]+counter[i+1] if the_num>the_max: the_max=the_num print the_max