#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[100010];
  vector<int> L;
  for (int i = 0; i < n; i++) cin >> a[i];
  L.push_back(a[0]);
  for (int i = 1; i < n; i++) {
    if (a[i] <= L.back())
      L.back() = a[i];
    else
      L.push_back(a[i]);
  }
  cout << (L.size()) << endl;
  return 0;
}
