#include #include #include #include #include #include #include #include #include using namespace std; int main() { int n; cin >> n; vector> a(1); for (int i = 0; i < n; i++){ int t; cin >> t; a[0].push_back(t); } sort(a[0].begin(), a[0].end()); for (int i = 0; i < a.size(); i++){ for (int j = 0; j < a[i].size() - 1; j++){ if (a[i][j] + 1 >= a[i][j+1]){ if (a.size() == i+1) a.push_back({a[i][j+1]}); else a[i+1].push_back(a[i][j+1]); a[i].erase(a[i].begin() + j + 1); } } } cout << a.size() << endl; }