#include <bits/stdc++.h>
int main() {
  int n;
  int arr[10000] = {};
  int que = 0;
  int day = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &arr[i]);
  }
  for (int j = 1; j <= n; j++) {
    if (arr[j] > que) que = arr[j];
    if (que == j) day++;
  }
  printf("%d", day);
  return 0;
}
