#include <bits/stdc++.h>
using namespace std;
int arr[100500], a[100500];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) scanf("%d", &arr[i]), a[i] = arr[i];
  sort(a, a + n);
  int ans = 0, sum = 0;
  for (int i = 0; i < n; i++) {
    sum += (arr[i] - a[i]);
    if (sum == 0) ans++;
  }
  cout << ans << endl;
  return 0;
}
