#include <bits/stdc++.h>
using namespace std;

int main() {
int ans = 0;
int N;
cin >> N;
int Min = N+1;
int P;
for (int i = 0; i < N; i++)
{
    cin >> P;
    if(P < Min){
        ans += 1;
        Min = P;
    }
}

cout << ans << endl;
}