#include <bits/stdc++.h>
using namespace std;
pair<int, int> input[100005], sorted[100005];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> input[i].first;
    input[i].second = i;
    sorted[i] = input[i];
  }
  sort(sorted + 1, sorted + n + 1);
  for (int i = 1; i <= n; i++) {
    input[sorted[i].second].second = i;
  }
  long long count = 0;
  int maxi = 0;
  for (int i = 1; i <= n; i++) {
    if (i >= maxi && input[i].second <= i)
      count++;
    else {
      maxi = max(maxi, input[i].second);
    }
  }
  cout << count << endl;
}
