#include #include #include #include using namespace std; using ll = long long; int main() { int N; cin >> N; assert(1 <= N && N <= 100000); vector A(N); for (int i = 0; i < N; i++) { cin >> A[i]; assert(1 <= A[i] && A[i] <= 1000000000); if (i) assert(A[i - 1] != A[i]); } sort(A.begin(), A.end()); for (int i = 0; i < N - 1; i++) { if (A[i] + 1 == A[i + 1]) { cout << 2 << '\n'; return 0; } } cout << 1 << '\n'; }