#include <bits/stdc++.h>
using namespace std;
long long MOD = 1e9 + 7;
void init() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
void solve() {
  long long n;
  cin >> n;
  vector<long long> v(n + 100);
  for (long long i = 1; i <= n; ++i) cin >> v[i];
  vector<long long> rM(n + 100, INT_MAX);
  for (long long i = n; i >= 1; --i) {
    rM[i] = min(rM[i + 1], v[i]);
  }
  long long ans = 0;
  long long curr_max = v[1];
  for (long long i = 1; i < n; ++i) {
    curr_max = max(curr_max, v[i]);
    if (curr_max <= rM[i + 1]) {
      ans++;
      curr_max = INT_MIN;
    }
  }
  ans++;
  cout << ans << endl;
}
int main() {
  init();
  long long t = 1;
  while (t--) {
    solve();
  }
}
