#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000 + 100;
const int inf = 0x3f3f3f3f;
int a[maxn], sorted[maxn];
int main() {
  int n;
  while (~scanf("%d", &n)) {
    memset(sorted, 0, sizeof(sorted));
    for (int i = 0; i < n; ++i) {
      scanf("%d", &a[i]);
      sorted[i] = a[i];
    }
    sort(sorted, sorted + n);
    int ans = 0;
    int init = 0;
    int temp = 0;
    for (int i = 0; i < n; ++i) {
      temp += a[i];
      init += sorted[i];
      temp == init ? ans++ : 1;
    }
    printf("%d\n", ans);
  }
  return 0;
}
