#include <bits/stdc++.h>
using namespace std;
int main() {
  long n;
  cin >> n;
  long a[n];
  long b[n + 1];
  for (long i = 0; i < n; i++) {
    cin >> a[i];
    b[i] = a[i];
  }
  for (int i = n - 1; i > 0; i--) {
    b[i - 1] = min(b[i], b[i - 1]);
  }
  b[n] = LONG_MAX;
  for (int j = 1; j < n; j++) {
    a[j] = (max(a[j], a[j - 1]));
  }
  long parts = 0;
  for (long i = 0; i < n; i++) {
    if (a[i] <= b[i + 1]) parts++;
  }
  cout << parts;
  return 0;
}
