#include <bits/stdc++.h>
using namespace std;
const int N = 100004;
int v[N];
int main(void) {
  priority_queue<int> q;
  int x, n;
  cin >> n;
  int res = 0;
  set<pair<int, int> > S;
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    S.insert(make_pair(x, i + 1));
  }
  int k = 1;
  for (auto it : S) {
    v[it.second] = k++;
  }
  for (int i = 1; i <= n; ++i) {
    x = v[i];
    q.push(x);
    if (q.top() == i) {
      res++;
      while (q.size()) q.pop();
    }
  }
  cout << res << endl;
  return 0;
}
