#include //#include //using namespace atcoder; using namespace std; #pragma region Macros using ll = long long; #define int ll using pii = pair; using tiii = tuple; template using V = vector; template using VV = V>; #define IOS\ ios::sync_with_stdio(false);\ cin.tie(0);\ cout.tie(0); #define FOR(i,l,r) for(int i=(l);i=int(r);--i) #define RREP(i,n) RFOR(i,n-1,0) #define RREPS(i,n) RFOR(i,n,1) #define mp make_pair #define mt make_tuple #define pb push_back #define eb emplace_back #define all(x) (x).begin(),(x).end() #define SORT(name) sort(name.begin(), name.end()) #define RSORT(name)\ SORT(name);\ reverse(all(name)); #define ZERO(p) memset(p, 0, sizeof(p)) #define MINUS(p) memset(p, -1, sizeof(p)) inline void Yes(bool b = true) {cout << (b ? "Yes" : "No") << '\n';} inline void YES(bool b = true) {cout << (b ? "YES" : "NO") << '\n';} template inline void print(T x){ cout << x << '\n';} template inline void chmin(T1 &a, T2 b){ if(a > b) a = b; } template inline void chmax(T1 &a, T2 b){ if(a < b) a = b; } const ll LLINF = (1LL<<60); const int INF = (1LL<<30); const double DINF = std::numeric_limits::infinity(); #pragma endregion const int MOD = 1000000007; #if 1 # define DBG(fmt, ...) printf(fmt, ##__VA_ARGS__) #else # define DBG(fmt, ...) #endif const int MAX_N = 100010; signed main() { IOS; int N; cin >> N; V<> A(N); REP(i, N) { cin >> A[i]; } SORT(A); priority_queue, greater > pq; REP(i, N) { if(i == 0) { pq.push(A[i]); continue; } int a = pq.top(); pq.pop(); if(a + 1 >= A[i]) { pq.push(a); } pq.push(A[i]); } print(pq.size()); return 0; }