#include <bits/stdc++.h>
using namespace std;
int a[100000], b[100000];
int main() {
  int x = 0, n, r = 0;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    b[i] = a[i];
  }
  sort(b, b + n);
  for (int i = 0; i < n; ++i) {
    x = x + (a[i] - b[i]);
    if (x == 0) r++;
  }
  cout << r;
}
