#include #include #include int main() { size_t n; std::cin >> n; std::set st; for (size_t i = 0; i < n; i++) { int a; std::cin >> a; st.insert(a); } int ans = 0; assert(st.size() == n); while (not st.empty()) { int cur = *st.begin(); st.erase(st.begin()); ans++; while (not st.empty()) { auto next = st.upper_bound(cur + 1); if (next == st.end()) break; cur = *next; st.erase(next); } } assert(ans == 1 or ans == 2); std::cout << ans << '\n'; return 0; }