#include <bits/stdc++.h>
bool comp(const int& a, const int& b) { return a < b ? false : true; }
using namespace std;
long long int a[100009];
long long int b[100009];
queue<int> q;
int z[100009];
multimap<long long int, int> asd;
int main() {
  int n, i, j;
  cin >> n;
  for (i = 0; i < n; i++) {
    q.push(i);
  }
  for (i = 0; i < n; i++) {
    cin >> a[i];
    b[i] = a[i];
  }
  sort(b, b + n);
  for (i = 0; i < n; i++) {
    asd.insert(std::pair<long long int, int>(b[i], i));
  }
  int grp = 0, max_index = -1;
  for (i = 0; i < n; i++) {
    multimap<long long int, int>::iterator it = asd.find(a[i]);
    int index = it->second;
    asd.erase(it);
    if (max_index < index) max_index = index;
    z[index] = 1;
    while (!q.empty() && z[q.front()] == 1) {
      q.pop();
    }
    int top = q.front();
    if (!q.empty() && top >= max_index) {
      grp++;
    }
  }
  cout << grp + 1;
  return 0;
}
