// fest #include #define pb push_back #define F first #define S second #define y1 dasdasfasfas #define x1 wqdadfasfasfas #define All(c) c.begin(), c.end() #define SZ(A) (int((A).size())) #define umap unordered_map #define __ fflush(stdout) typedef long long ll; typedef long double ld; using namespace std; inline double Time() {return (clock() * 1.0) / CLOCKS_PER_SEC; } const int N = 200500, inf = 1e9 * 2, MOD = 1e9 + 7; char CH[N]; const ll INF = 1e18; const int dx[] = {1, -1, 0, 0, -1, 1, -1, 1}; const int dy[] = {0, 0, 1, -1, -1, 1, 1, -1}; int a[N]; int main() { unsigned int FOR; asm("rdtsc" : "=A"(FOR)); srand(FOR); int n; cin >> n; for (int i = 1; i <= n; i++) cin >> a[i]; int ans = 0; for (int i = 1; i < 100; i++) { int now = 0; for (int j = 1; j <= n; j++) { if (i - a[j] <= 1 && i - a[j] >= 0) now++; } ans = max(ans, now); } cout << ans; return 0; }