#include <bits/stdc++.h>
int main() {
  int i, n, a[100000], day = 0, max = 0, t;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    if (a[i] > max) {
      t = a[i];
      a[i] = max;
      max = t;
    }
    if (max == i + 1)
      day++;
    else
      continue;
  }
  printf("%d", day);
}
