#include using namespace std; using ll = long long; constexpr char newl = '\n'; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int n; cin >> n; vector a(n); for (int i = 0; i < n; i++) { cin >> a[i]; } sort(a.begin(), a.end()); for (int i = 1; i < n; i++) { if (a[i] - a[i - 1] <= 1) { cout << 2 << newl; return 0; } } cout << 1 << newl; return 0; }