#include <bits/stdc++.h>
using namespace std;
const int mod = (int)1e9 + 7, mx = (int)1e6 + 1;
pair<int, int> ne[4] = {make_pair(0, 1), make_pair(1, 0), make_pair(-1, 0),
                        make_pair(0, -1)};
pair<int, int> ar[mx];
int main() {
  int n;
  cin >> n;
  int j;
  for (int i = 0; i < n; ++i) {
    scanf("%d", &j);
    ar[i] = make_pair(j, i);
  }
  sort(ar, ar + n);
  int ans = 0;
  int curr_seg = 0;
  for (int i = 0; i < n; ++i) {
    curr_seg = max(curr_seg, ar[i].second);
    if (i >= curr_seg) ans++;
  }
  cout << ans;
  return 0;
}
