#include <bits/stdc++.h>
using namespace std;
const double pi = atan(1.0) * 4;
const int NN = 1e5 + 10;
int N;
int a[NN], b[NN];
map<int, int> mp;
int find(int val) {
  int low = 0, high = N - 1, mid;
  while (low < high) {
    mid = (low + high) >> 1;
    if (b[mid] >= val)
      high = mid;
    else
      low = mid + 1;
  }
  return low;
}
int main() {
  while (scanf("%d", &N) == 1) {
    for (int i = 0; i < N; i++) {
      scanf("%d", a + i);
      b[i] = a[i];
    }
    mp.clear();
    sort(b, b + N);
    int idx = 0, ans = 0;
    for (int i = 0; i < N; i++) {
      int tmp = find(a[i]);
      tmp += mp[a[i]];
      mp[a[i]]++;
      idx = max(idx, tmp);
      if (i == idx) ans++, idx = i + 1;
    }
    printf("%d\n", ans);
  }
  return 0;
}
