#include <bits/stdc++.h>
using namespace std;
map<int, int> cntb;
map<int, int> cnta;
int main() {
  int n;
  scanf("%d", &n);
  int a[n], b[n];
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    b[i] = a[i];
  }
  sort(b, b + n);
  int vul = 0;
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    cntb[b[i]]++;
    cnta[a[i]]++;
    if (a[i] == b[i]) {
      if (vul == 0) {
        cnt++;
      }
      continue;
    }
    if (cnta[b[i]] == cntb[b[i]])
      vul--;
    else if (cnta[b[i]] == cntb[b[i]] - 1)
      vul++;
    if (a[i] == b[i])
      ;
    else if (cnta[a[i]] == cntb[a[i]])
      vul--;
    else if (cntb[a[i]] == cnta[a[i]] - 1)
      vul++;
    if (vul == 0) {
      cnt++;
    }
  }
  printf("%d\n", cnt);
  return 0;
}
