#include <bits/stdc++.h>
using namespace std;
const int Maxn = 100 * 1000 + 10;
int n, arr[Maxn], Min[Maxn], ans;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) scanf("%d", &arr[i]);
  Min[n - 1] = arr[n - 1];
  for (int i = n - 2; i >= 0; i--) Min[i] = min(Min[i + 1], arr[i]);
  for (int i = 0; i < n; i++) {
    int Max = arr[i], j = i;
    while (j + 1 < n && Max > Min[j + 1]) {
      j++;
      if (arr[j] > Max) Max = arr[j];
    }
    ans++;
    i = j;
  }
  cout << ans << endl;
  return 0;
}
