#include <bits/stdc++.h>
using namespace std;
int arr2[100005];
int main() {
  int n, c = 0, x = -1e9;
  cin >> n;
  int arr1[n];
  for (int i = 0; i < n; i++) {
    cin >> arr1[i];
  }
  arr2[n] = 1e9;
  for (int i = n - 1; i >= 0; i--) {
    arr2[i] = min(arr2[i + 1], arr1[i]);
  }
  for (int i = 0; i < n; i++) {
    x = max(arr1[i], x);
    if (x <= arr2[i + 1]) c++;
  }
  cout << c << endl;
  return 0;
}
