#include #include using namespace atcoder; using namespace std; using ll=long long; using ld=double; ld pie=3.14159265359; ll mod=998244353; long long inf=100000000000000001; int main(){ ll n; cin >> n; vectora(n); for (ll i = 0; i < n; i++) { cin >> a[i]; } ll dai=a[0]; ll ans=0; for (ll i = 1; i < n; i++) { if (dai>a[i]) { ans+=1; } dai=max(dai,a[i]); } cout << ans << endl; }