#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  long long a[100010];
  long long b[100010];
  long long n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    b[i] = a[i];
  }
  sort(b, b + n);
  map<long long, long long> x, y;
  long long ans = 0;
  for (int i = 0; i < n; ++i) {
    x[a[i]]++;
    y[b[i]]++;
    if (x == y) {
      x.clear();
      y.clear();
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
