#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
struct gg {
  int h;
  int id;
} g[maxn];
int b[maxn];
bool cmp(gg g1, gg g2) {
  return g1.h < g2.h || (g1.h == g2.h && g1.id < g2.id);
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> g[i].h;
    g[i].id = i;
  }
  sort(g, g + n, cmp);
  int sum = 0;
  int pos = 0;
  memset(b, 0, sizeof(b));
  int l = 0;
  for (int i = 0; i < n; ++i) {
    b[g[i].id] = 1;
    l = max(l, g[i].id);
    while (b[pos]) {
      pos++;
    }
    if (pos == l + 1) {
      sum++;
    }
  }
  cout << sum << endl;
  return 0;
}
