#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

typedef long long ll;

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