#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define REP(i,n) for(int i=0; i=b; --i) #define pi M_PI typedef long long ll; typedef vector VI; typedef vector VL; typedef vector VVI; typedef pair P; typedef pair PL; int main(){ int n; cin >> n; VI a(n); REP(i,n) scanf("%d", &a[i]); int ma = a[0]; int ans = 0; REP(i,n){ if (a[i] < ma) ans++; else ma = a[i]; } cout << ans << endl; return 0; }