/** * author: shu8Cream * created: 26.03.2021 21:18:21 **/ #include using namespace std; #define rep(i,n) for (int i=0; i<(n); i++) #define all(x) (x).begin(), (x).end() using ll = long long; using P = pair; using vi = vector; using vvi = vector; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int n; cin >> n; vector

a(n); rep(i,n){ cin >> a[i].first; a[i].second = i; } sort(all(a)); int ans = 0; vi used(n); rep(i,n){ if(used[a[i].second]) continue; ans++; used[a[i].second]=1; used[max(0,a[i].second-1)]=1; } cout << ans << endl; }