#include <bits/stdc++.h>
using namespace std;
void task();
int main() {
  task();
  return 0;
}
const int N = (int)1e5 + 10;
const long long int MODULO = (long long int)1e9 + 7;
const int INF = (int)1e9 + 10;
const int BUF_SIZE = (int)1e4 + 10;
int n;
int a[N], b[N];
void task() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    b[i] = a[i];
  }
  sort(b, b + n);
  int val = 0, cnt = 0, ans = 0;
  for (int i = 0; i < n; ++i) {
    if (!cnt && a[i] == b[i]) {
      ++ans;
      continue;
    }
    if (!cnt) {
      val = a[i];
      cnt = 1;
      ++ans;
    } else {
      if (a[i] > val) {
        val = a[i];
        cnt = 1;
      } else if (a[i] == val)
        ++cnt;
      if (val == b[i]) --cnt;
    }
  }
  cout << ans;
}
