#include <bits/stdc++.h>
using namespace std;
inline int in() {
  int x;
  scanf("%d", &x);
  return x;
}
const int N = 1e5 + 10;
const int MOD = 1e9 + 7;
const long double eps = 1e-12;
int n, h[N], fen[N], ans;
vector<pair<int, int> > vec;
void add(int ind, long long val) {
  for (; ind < N; ind += ind & -ind) fen[ind] += val;
}
long long get(int ind) {
  long long ret = 0;
  for (; ind > 0; ind -= ind & -ind) ret += fen[ind];
  return ret;
}
int main() {
  n = in();
  for (int i = 0; i < n; i++) {
    h[i] = in();
    vec.push_back({h[i], i});
  }
  sort(vec.begin(), vec.end());
  for (int i = 0; i < n; i++) {
    pair<int, int> x = {h[i], i};
    h[i] = lower_bound(vec.begin(), vec.end(), x) - vec.begin() + 1;
  }
  for (int i = 1; i <= n; i++) {
    add(h[i - 1], +1);
    if (get(i) == i) ans++;
  }
  cout << ans;
  return 0;
}
