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