#include <bits/stdc++.h>
int main() {
  int n, vet[100009], sorted[100009], available[100009], res = 0, block = -1,
                                                         low, up, next;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", vet + i);
    sorted[i] = vet[i];
    available[i] = 1;
  }
  std::sort(sorted, sorted + n);
  for (int i = 0; i < n; i++) {
    low = (int)(std::lower_bound(sorted, sorted + n, vet[i]) - sorted);
    up = (int)(std::upper_bound(sorted, sorted + n, vet[i]) - sorted);
    next =
        (int)(std::lower_bound(available + low, available + up, 1) - available);
    available[next] = 0;
    if (next > block) block = next;
    if (block == i) res++;
  }
  printf("%d\n", res);
  return 0;
}
