#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> yama(n);
  int count = 1;
  int max_yama = yama[0];
  for (int i = 1; i < n; i++) {
    if (yama[i] - max_yama < 0) {
      count++;
      max_yama = yama[i];
    }
  }
  cout << count << endl;
  return 0;
}
