/* TASK: Picking Numbers LANG: C++ */ #include using namespace std; #define X first #define Y second #define EPS 1e-9 #define ALL(x) (x).begin(),(x).end() #define mp(x,y) make_pair((x),(y)) #define pb(x) push_back((x)) #define FOR(i,st,ed) for(int (i)=(st);(i)<(ed);(i)++) typedef pair PII; typedef vector vi; typedef vector > vii; typedef long long LL; int N,M,T; int co[127]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); //freopen("xxx.in","r",stdin); //freopen("xxx.out","w",stdout); int i,j,k; cin >> N; while(N--) { cin >> k; co[k]++; } int Mc=0; for(i=1;i<100;i++) Mc=max(Mc,co[i]+co[i+1]); cout << Mc << '\n'; return 0; }