#include <bits/stdc++.h>
using namespace std;
bool cmp1(pair<int, int> a, pair<int, int> b) {
  if (a.first == b.first) return a.second < b.second;
  return a.first < b.first;
}
int main() {
  int n;
  scanf("%d", &n);
  vector<pair<int, int> > data, pos;
  for (int i = 1; i <= n; i++) {
    int a;
    scanf("%d", &a);
    data.push_back(make_pair(a, i));
  }
  sort(data.begin(), data.end(), cmp1);
  for (int i = 0; i < data.size(); i++) {
    pos.push_back(
        make_pair(min(i + 1, data[i].second), max(i + 1, data[i].second)));
  }
  sort(pos.begin(), pos.end(), cmp1);
  int res = 1, last = pos[0].second;
  for (int i = 1; i < pos.size(); i++) {
    if (pos[i].first > last) {
      res++;
    }
    last = max(last, pos[i].second);
  }
  cout << res;
  printf("\n");
  return 0;
}
