#include <bits/stdc++.h>
using namespace std;
int a[100050], b[100050];
map<int, int> my;
map<int, int> r1, r2;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    b[i] = a[i];
  }
  sort(b, b + n);
  int sum = 0;
  for (int i = 0; i < n; i++) {
    r1[a[i]]++;
    r2[b[i]]++;
    if (r1 == r2) {
      sum++;
      r1.clear();
      r2.clear();
    }
  }
  cout << sum;
  return 0;
}
