#include using namespace std; #define ALL(v) v.begin(), v.end() #define V vector #define P pair using ll = long long; int main() { int n; cin >> n; V a(n); for(int i = 0; i < n; i++) cin >> a[i]; sort(ALL(a)); int ans = 1; ll pre = a[0]; for(int i = 1; i < n; i++){ if(pre + 1 < a[i]){ pre = a[i]; }else{ pre = a[i]; ans++; } } cout << ans << endl; return 0; }