#include <bits/stdc++.h>
const int MAXN = 100005;
using namespace std;
int h[MAXN], n;
pair<int, int> p[MAXN];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &h[i]);
    p[i].first = h[i];
    p[i].second = i;
  }
  sort(p + 1, p + n + 1);
  int Max = 0, ans = 0;
  for (int i = 1; i <= n; i++) {
    if (p[i].second > Max) Max = p[i].second;
    if (i == Max) ans++;
  }
  printf("%d\n", ans);
  return 0;
}
