#include using namespace std; typedef long long int ll; typedef pair P; typedef vector VI; typedef vector VVI; #define REP(i,n) for(int i=0;i<(n);i++) #define ALL(v) v.begin(),v.end() constexpr ll MOD=998244353; constexpr ll INF=2e18; int main(){ int n; cin >> n; VI a(n); REP(i,n) cin >> a[i]; vector

p(n); REP(i,n) p[i]={a[i],i}; sort(ALL(p)); VI f(n,0); int ans=0; REP(i,n){ if(p[i].second==n-1||!f[p[i].second+1]){ ans++; f[p[i].second]=1; } } cout << ans << endl; return 0; }