#include <bits/stdc++.h>
int a, b, c, now, ans;
int main() {
  scanf("%d", &a);
  ;
  for (int s = 1; s <= a; s++) {
    scanf("%d", &b);
    ;
    now = now > b ? now : b;
    if (s >= now) ans++;
  }
  printf("%d", ans);
  ;
}
