#include <bits/stdc++.h>
using namespace std;
int n;
int h[100005], f[100005];
pair<int, int> A[100005];
int main() {
  scanf("%d", &n);
  for (int i = int(0); i < int(n); i++) scanf("%d", h + i);
  for (int i = int(0); i < int(n); i++) {
    A[i] = {h[i], i};
  }
  sort(A, A + n);
  for (int i = int(0); i < int(n); i++) {
    f[A[i].second] = i;
  }
  int ans = 0, mx = 0;
  for (int i = int(0); i < int(n); i++) {
    mx = max(mx, f[i]);
    if (mx == i) ans++;
  }
  printf("%d\n", ans);
  return 0;
}
