#include <bits/stdc++.h>
using namespace std;
const int MAX = 101000;
int n;
int a[MAX];
int b[MAX];
multiset<int> s;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d", &a[i]);
  for (int i = 0; i < n; ++i) s.insert(a[i]);
  int res = 0;
  int cur = 0;
  for (int i = 0; i < n; ++i) {
    cur = max(cur, a[i]);
    s.erase(s.lower_bound(a[i]));
    if (s.lower_bound(cur) == s.begin()) {
      ++res;
      cur = 0;
    }
  }
  printf("%d\n", res);
}
