#include <bits/stdc++.h>
using namespace std;
int N, cnt = 0;
pair<int, int> ar[100010];
int main() {
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    scanf("%d", &ar[i].first);
    ar[i].second = i;
  }
  sort(ar, ar + N);
  int pos = -1;
  for (int i = 0; i < N; i++) {
    int it = (int)(lower_bound(ar, ar + N, make_pair(ar[i].first, -1)) - ar);
    pos = max(ar[it].second, pos);
    if (i == pos) {
      cnt++;
    }
    ar[it].second = -2;
  }
  printf("%d\n", cnt);
  return 0;
}
