#include <bits/stdc++.h>
using namespace std;
inline int in() {
  int res = 0;
  char c;
  while ((c = getchar()) < '0' || c > '9')
    ;
  while (c >= '0' && c <= '9') res = res * 10 + c - '0', c = getchar();
  return res;
}
const int N = 100100;
long long a[N];
multiset<long long> s;
int main() {
  int n = in();
  for (int i = 0; i < n; i++) {
    a[i] = in();
    s.insert(a[i]);
  }
  long long ans = 0, j, mx;
  for (int i = 0; i < n; i++) {
    mx = 0;
    for (j = i; j < n; j++) {
      s.erase(s.find(a[j]));
      mx = max(mx, a[j]);
      if (s.size() == 0 || (*(s.begin()) >= a[i] && mx <= *(s.begin()))) {
        ans++;
        i = j;
        break;
      }
    }
  }
  cout << ans;
  return 0;
}
