#include <bits/stdc++.h>
using namespace std;
int n, ans;
pair<int, int> arr[100005];
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> arr[i].first;
    arr[i].second = i + 1;
  }
  sort(arr, arr + n);
  long long s = 0, done = 0;
  for (long long i = 1; i <= n; i++) {
    s += arr[i - 1].second;
    if (s == (i * (i + 1)) / 2 - done) {
      ans++;
      done = (i * (i + 1)) / 2;
      s = 0;
    }
  }
  cout << ans << endl;
}
