#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, answer = 0;
  cin >> n;
  int h[n], g[n];
  for (int i = 0; i < n; i++) cin >> h[i], g[i] = h[i];
  sort(g, g + n);
  map<int, int> a, b;
  set<int> c;
  for (int i = 0; i < n; i++) {
    a[h[i]]++;
    b[g[i]]++;
    if (a[g[i]] != b[g[i]])
      c.insert(g[i]);
    else
      c.erase(g[i]);
    if (a[h[i]] != b[h[i]])
      c.insert(h[i]);
    else
      c.erase(h[i]);
    answer += c.empty();
  }
  cout << answer;
}
