#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j[100005], temp = -1, sum = 0, max[100005];
  cin >> n;
  for (i = 0; i < n; i++) {
    scanf("%d", &j[i]);
    if (j[i] > temp)
      temp = max[i] = j[i];
    else
      max[i] = temp;
  }
  temp = max[n - 1];
  for (i = n - 1; i >= 0; i--) {
    if (temp >= max[i]) sum++;
    if (j[i] < temp) temp = j[i];
  }
  cout << sum << endl;
}
