#include using namespace std; using ll = long long; int main(){ cin.tie(nullptr); ios_base::sync_with_stdio(false); ll N, ans=0; cin >> N; unordered_map mp; vector A(N); //Nの作り方=(N-1が元からある時のみ)N-2の作り方 for (int i=0; i> A[i]; mp[A[i]]++; } sort(A.begin(), A.end()); for (auto x : A){ if (mp.count(x-1)) mp[x+1] += mp[x-1]; } for (auto [x, y] : mp){ ans += y; } cout << ans << endl; return 0; }