#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  vector<long long> maxim(n + 1, INT_MIN);
  vector<long long> minim(n + 1, INT_MAX);
  for (long long i = 0; i < n; i++) cin >> a[i];
  for (long long i = n - 1; i >= 0; i--) {
    maxim[i] = max(maxim[i + 1], a[i]);
    minim[i] = min(minim[i + 1], a[i]);
  }
  long long b = 0, curr_max = a[0], curr_min = a[0];
  for (long long i = 1; i < n; i++) {
    if (curr_max <= minim[i]) {
      b++;
      curr_max = a[i];
      curr_min = a[i];
      continue;
    }
    curr_max = max(curr_max, a[i]);
    curr_min = min(curr_min, a[i]);
  }
  b++;
  cout << b << endl;
  return;
}
int main() {
  long long n;
  n = 1;
  while (n--) {
    solve();
  }
}
