#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, cd = 0;
  cin >> n;
  int v[n], v1[n];
  for (int i = 0; i < n; ++i) {
    cin >> v[i];
    v1[i] = v[i];
  }
  sort(v1, v1 + n);
  int res = 0;
  for (int i = 0; i < n; ++i) {
    res = res + (v1[i] - v[i]);
    if (res == 0) cd++;
  }
  cout << cd << endl;
  return 0;
}
