#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-7;
int n;
int h[100005];
map<int, int> a;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", h + i);
    a[h[i]]++;
  }
  int i = 0;
  int minx = h[0], mint;
  int cnt = 0;
  mint = a.begin()->first;
  while (i < n) {
    int j = i;
    while (a[mint]) {
      a[h[j]]--;
      if (h[j] > minx) minx = h[j];
      j++;
      if (h[j - 1] == mint) break;
    }
    if (j == n) {
      cnt++;
      break;
    }
    if (a[mint] == 0) a.erase(mint);
    mint = a.begin()->first;
    while (a[mint] == 0) {
      a.erase(mint);
      mint = a.begin()->first;
    }
    if (mint >= minx) cnt++;
    i = j;
  }
  printf("%d\n", cnt);
}
