#include <bits/stdc++.h>
using namespace std;
int n;
int a[100010];
int suf[100010];
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    scanf("%d", a + i);
  }
  suf[n] = 1000000000;
  for (int i = n - 1; i >= 0; --i) {
    suf[i] = min(suf[i + 1], a[i]);
  }
  int res = 0;
  for (int i = 0, j; i < n; i = j) {
    ++res;
    int tmp = a[i];
    for (j = i + 1; suf[j] < tmp; ++j) {
      tmp = max(tmp, a[j]);
    }
  }
  cout << res << endl;
  return 0;
}
