#include <bits/stdc++.h>
using namespace std;
pair<int, int> a[200005];
int main() {
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    a[i] = make_pair(x, i);
  }
  sort(a, a + n);
  int minn = 0, maxx = a[0].second, cur = 1;
  int ans = 1;
  for (int i = 1; i < n; i++) {
    if (maxx - minn + 1 == cur) {
      ans++;
      minn = maxx + 1;
      maxx = a[i].second;
      cur = 1;
      continue;
    }
    maxx = max(maxx, a[i].second);
    cur++;
  }
  cout << ans << endl;
}
