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

int main() {
	ll n,sm,c,i,num;
    cin>>n;
    sm=n+1; c=0;
    for(i=0;i<n;i++) {
    	cin>>num;
    	if(num<sm) {
    		sm=num;
    		c++;
		}
	}
	cout<<c;
}