/**
 *   @FileName	a.cpp
 *   @Author	kanpurin
 *   @Created	2020.11.13 21:25:20
**/

#include "bits/stdc++.h" 
using namespace std; 
typedef long long ll;

int main() {
    int n;cin >> n;
    vector<int> c(2,0);
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    sort(a.begin(), a.end());
    int ans = 1;
    for (int i = 0; i < n-1; i++) {
        if (a[i+1]-a[i]==1) {
            ans = 2;
        }
    }
    cout << ans << endl;
    return 0;
}