#include using namespace std; typedef long long int ll; typedef unsigned long long int ull; typedef vector vs; typedef vector vi; typedef vector vll; typedef vector > vvi; #define forn(i,x,y) for(i = (x) ; i <= (y) ; ++i) #define forr(i,y,x) for(i = (y) ; i >= (x) ; --i) #define forv(v,i) for(i=v.begin();i!=v.end();++i) #define forvr(v,i) for(i=v.end()-1;i!=v.begin();--i) #define FA(i, a) for (__typeof((a).begin()) i = (a).begin(); i != (a).end(); i++) #define PB push_back #define PF push_front #define MP make_pair #define F first #define S second #define SZ(x) ((int)(x).size()) #define MOD(x,y) (((x%M)*(y%M))%M) #define CLR(x,y) memset(x,y,sizeof(x)) #define precisionvalue printf("%.6lf\n",ans); ll M=1000000007; //while(~scanf("%d",&n) ) /*-------------------------Template Ends--------------------------------*/ ll arr[1000]; int main() { // ios::sync_with_stdio(0); // cin.tie(0); ll i,j,k,n,m,p,q,u,v,count,ans,temp,test,maxi; cin >> n; forn(i,0,110) arr[i]=0; forn(i,1,n) { cin >> u; arr[u]++; } maxi=0; forn(i,0,99) { maxi=max(maxi,arr[i]+arr[i+1]); } cout << maxi << endl; return 0; }