#define rep(i, l, r) for (auto i = (l); i < (r); i++) #define chmax(dest, src) if ((dest) < (src)) dest = (src) #define chmin(dest, src) if ((dest) > (src)) dest = (src) #include using namespace std; int main() { int N; cin >> N; vector A(N); rep(i, 0, N) cin >> A[i]; sort(A.begin(), A.end()); int count = 1; int c = 1; int prev = 0; for_each(A.begin(), A.end(), [&](int a) { if (prev + 1 >= a) { c++; } else { chmax(count, c); c = 1; } prev = a; }); cout << count; return 0; }