#include #include #include #include using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) #define TRACE(x) cout << #x << " = " << x << endl #define _ << " _ " << typedef long long llint; int main(void) { int n; scanf("%d", &n); vector cnt(111); REP(i, n) { int x; scanf("%d", &x); cnt[x]++; } int ans = 0; REP(i, 100) ans = max(ans, cnt[i]+cnt[i+1]); printf("%d\n", ans); return 0; }