#include <bits/stdc++.h>
using namespace std;
int a[10100] = {0};
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  int i = 0;
  int start = 1, t = 0;
  while (1) {
    i = a[start];
    for (; start <= i; start++) {
      if (a[start] > i) i = a[start];
    }
    start--;
    t++;
    if (start >= n) break;
    start++;
  }
  cout << t << endl;
  return 0;
}
