#include <bits/stdc++.h>
using namespace std;
int h[100005], s[100005];
int main() {
  int n, ans = 0;
  long long sum = 0LL;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &h[i]);
    s[i] = h[i];
  }
  sort(s, s + n);
  for (int i = 0; i < n; i++) {
    sum += s[i] - h[i];
    if (sum == 0LL) ans++;
  }
  printf("%d\n", ans);
  return 0;
}
