#include <bits/stdc++.h>
using namespace std;
long long int r, s, n, a[100007], b[100007];
int main() {
  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++) s += (a[i] - b[i]), r += !s;
  cout << r;
}
