#include #include #include #include #include using namespace std; template ostream& operator<<(ostream& o, vector& v) { o << '['; for (int i = 0; i < v.size(); i++) o << (i > 0 ? ", " : "") << v[i]; o << ']'; return o; } int main() { int N; cin >> N; vector v(N); for (int i = 0; i < N; i++) cin >> v[i]; sort(v.begin(), v.end()); int ans = 1; for (int i = 1; i < v.size(); i++) { if (!(v[i-1]+1 < v[i])) ans++; } cout << ans << endl; }