#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  int prefix[n], suffix[n];
  prefix[0] = arr[0];
  suffix[n - 1] = pow(10, 9);
  for (int i = 1; i < n; i++) prefix[i] = max(prefix[i - 1], arr[i]);
  for (int i = n - 2; i >= 0; i--) suffix[i] = min(suffix[i + 1], arr[i + 1]);
  int blocks = 0;
  for (int i = 0; i < n; i++)
    if (prefix[i] <= suffix[i]) blocks++;
  cout << blocks;
}
