#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
int a[maxn], m1[maxn], m2[maxn];
vector<pair<int, int> > v;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i], v.push_back(make_pair(a[i], i));
  m1[0] = a[0];
  sort(v.begin(), v.end());
  m2[n - 1] = a[n - 1];
  for (int i = 1; i < n; i++) m1[i] = max(a[i], m1[i - 1]);
  for (int i = n - 2; i >= 0; i--) m2[i] = min(a[i], m2[i + 1]);
  int ans = 0;
  int ind = n - 1;
  while (v.size()) {
    if (v.back().second > ind) {
      v.pop_back();
      continue;
    }
    int t = v.back().second;
    for (; t >= 0; t--) {
      if (!t || m2[t] >= m1[t - 1]) {
        ind = t - 1;
        ans++;
        break;
      }
    }
  }
  cout << ans << endl;
}
