#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x;
  scanf("%d", &n);
  int arr[n];
  vector<int> vec;
  for (int i = 0; i < n; ++i) {
    scanf("%d", arr + i);
    vec.push_back(arr[i]);
  }
  sort(vec.begin(), vec.end());
  int sum = 0, ans = 0;
  for (int i = 0; i < n; ++i) {
    sum += (arr[i] - vec[i]);
    ans += (sum == 0);
  }
  printf("%d", ans);
  return 0;
}
