#include <bits/stdc++.h>
using namespace std;
long long OO = 1e18;
long long Mod = 1e9 + 7;
long long const N = 1e5 + 10;
int a[N];
int id[N];
int main() {
  int n;
  cin >> n;
  vector<pair<long long, long long> > v;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    v.push_back({a[i], i});
  }
  sort((v).begin(), (v).end());
  for (int i = 0; i < n; i++) {
    id[v[i].second] = i;
  }
  int ans = 0;
  for (int i = 0; i < n;) {
    int r = id[i];
    while (i <= r) r = max(r, id[i]), i++;
    ans++;
  }
  cout << ans << endl;
}
