#include <bits/stdc++.h>
using namespace std;
int A[100005], B[100005], S[100005], T[100005];
int compress(int n) {
  int c = 0, i, j;
  map<int, int> M;
  memcpy(B, A, n * sizeof(int));
  sort(B, B + n);
  for (i = 0; i < n; i = j) {
    for (j = i + 1; j < n && B[j] == B[i]; ++j)
      ;
    M[B[i]] = ++c;
  }
  for (i = 0; i < n; ++i) {
    A[i] = M[A[i]];
    S[A[i]]++;
  }
  for (i = 1; i <= c; ++i) S[i] += S[i - 1];
  return c;
}
void update(int n, int idx) {
  for (int i = idx; i <= n; i += ((i) & (-(i)))) T[i]++;
}
int query(int idx) {
  int sum = 0, i;
  for (i = idx; i; i -= ((i) & (-(i)))) sum += T[i];
  return sum;
}
int solve(int n) {
  int m = compress(n), c = 0, maxVal = 0, i;
  for (i = 0; i < n; ++i) {
    update(m, A[i]);
    if (maxVal < A[i]) maxVal = A[i];
    if (query(maxVal - 1) == S[maxVal - 1]) c++, maxVal = 0;
  }
  return c;
}
int main() {
  int n, i;
  scanf("%d", &n);
  for (i = 0; i < n; ++i) scanf("%d", A + i);
  printf("%d\n", solve(n));
  return 0;
}
