#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> h(n);
  vector<int> sh(n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &h[i]);
    sh[i] = h[i];
  }
  sort(sh.begin(), sh.end());
  map<int, int> last;
  for (int i = 0; i < n; i++) {
    last[h[i]] = -1;
  }
  int r = 0, ans = 0;
  for (int i = 0; i < n; i++) {
    int nr = last[h[i]] + 1;
    if (nr == 0) nr = lower_bound(sh.begin(), sh.end(), h[i]) - sh.begin();
    last[h[i]] = nr;
    r = max(nr, r);
    if (i == r) ans++;
  }
  cout << ans << endl;
  return 0;
}
