#include using namespace std; int main() { int N; cin >> N; vector A( N ); for( int i = 0; i < N; i++ ) { cin >> A[i]; } sort( A.begin(), A.end() ); priority_queue, greater> que; que.push( A[0] ); for( int i = 1; i < N; i++ ) { int a = que.top(); if( A[i] > a + 1 ) { que.pop(); que.push( A[i] ); } else { que.push( A[i] ); } } int ans = que.size(); cout << ans << endl; }