#include <cstdio>
#include <algorithm>
using namespace std;
int main() {
	int N, P, mn = 1000000, ans = 0;
	scanf("%d", &N);
	for (int i = 0; i < N; ++i) {
		scanf("%d", &P);
		if (P < mn) ++ans, mn = P;
	}
	printf("%d", ans);
	return 0;
}