#include using namespace std; typedef long long int lld; typedef long double ldb; #define f first #define s second #define mp make_pair #define pb push_back // in the name of god int f[2010]; int main(){ int n; cin >> n; int x; for(int i = 0; i < n; i++){ cin >> x; f[x]++; f[x+1]++; } int mx = 0; for(int i = 0; i <=100; i++) mx = max(mx, f[i]); cout << mx << endl; }