#include using namespace std; using ll = long long; int main(){ cin.tie(nullptr); ios_base::sync_with_stdio(false); ll N, A, ans=0; cin >> N; set st; map mp; for (int i=0; i> A; st.insert(A); mp[A]++; } for (auto x : st){ mp[x+1] += mp[x-1]; } for (auto [x, y] : mp){ ans += y; } cout << ans << endl; return 0; }