#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[111111], b[111111], i, n, mx = 0, l = 1, mn = 1111111111, t = 0;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    b[i] = 1111111111;
  }
  for (i = n - 1; i >= 0; i--) {
    mn = min(a[i], mn);
    b[i] = mn;
  }
  for (i = 0; i < n; i++) {
    mx = max(mx, a[i]);
    if (a[i] == b[i]) t++;
    if (t && mx <= b[i + 1]) {
      l++;
      t = 0;
    }
  }
  cout << l;
  return 0;
}
