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

#define rep(i, n) for(int i = 0; i < n; ++i)

int main() {
  int n;
  cin >> n;
  queue<int> que;
  rep(i, n) {
    int p;
    cin >> p;
    if(i == 0) que.push(p);
    else {
      if(que.back() > p) que.push(p);
    }
  }
  cout << que.size() << endl;
}

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

#define vt          vector
#define sz(x)       int((x).size())
#define all(x)      (x).begin(), (x).end()
#define rall(x)     (x).rbegin(), (x).rend()
#define fi          first
#define se          second

using ll = long long;
using pii = pair<int, int>;

void solve() {
    int n;
    cin >> n;

    int mn = n + 1, ans = 0;
    while (n--) {
        int x;
        cin >> x;
        if (x < mn) mn = x, ans++;
    }

    cout << ans;
}

int main() {
    ios::sync_with_stdio(0), cin.tie(0);

    int tcs = 1;
    for (int tc = 1; tc <= tcs; tc++) {
        // cout << "Case " << tc << ": ";
        solve();
    }
}
