// Anve$hi $hukla #include using namespace std; struct ${$(){ios_base::sync_with_stdio(false);cin.tie(NULL);}}$; typedef long long LL; const int Maxn = 200005; int a[Maxn]; int main() { int n; cin >> n; map m; for(int i = 0; i < n; i++) { cin >> a[i]; m[a[i]]++; } int ans = 0; for(int i = 0; i < 100; i++) { ans = max(ans, m[i] + m[i + 1]); } cout << ans << endl; return 0; }