#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int arr[N];
int cop[N];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", arr + i);
    cop[i] = arr[i];
  }
  sort(cop, cop + n);
  map<int, int> mp;
  for (int i = 0; i < n; i++) {
    if (mp[cop[i]] == 0) {
      mp[cop[i]] = i + 1;
    }
  }
  int right = 0;
  int ans = 1;
  for (int i = 0; i < n; i++) {
    if (right < i) {
      ans++;
      right = i;
    }
    if (mp[arr[i]] - 1 > right) {
      right = mp[arr[i]] - 1;
    }
    mp[arr[i]]++;
  }
  printf("%d", ans);
  return 0;
}
