#include <bits/stdc++.h>
using namespace std;
struct bitTree {
  int tree[100005];
  void update(int x) {
    for (; x < 100005; x += (x & (-x))) tree[x]++;
  }
  int get(int x) {
    int re = 0;
    for (; x; x -= (x & (-x))) re += tree[x];
    return re;
  }
} t;
int n, h[100005], ans = 0;
pair<int, int> p[100005];
void setup() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> p[i].first, p[i].second = i;
  sort(p + 1, p + n + 1);
  for (int i = 1; i <= n; i++) h[p[i].second] = i;
}
void xuly() {
  int start = 1, maxI = 0;
  for (int i = 1; i <= n; i++) {
    maxI = max(maxI, h[i]);
    t.update(h[i]);
    if (t.get(maxI) - t.get(start - 1) == maxI - start + 1) {
      ans++;
      start = i + 1;
    }
  }
  cout << ans;
}
int main() {
  iostream::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  setup();
  xuly();
  return 0;
}
