#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, v[10000], maxx = 0, cnt = 0;
  cin >> n;
  for (i = 1; i <= n; i++) cin >> v[i];
  for (i = 1; i <= n; i++) {
    if (v[i] >= maxx) maxx = v[i];
    if (i >= maxx) {
      cnt++;
      maxx = 0;
    }
  }
  cout << cnt;
  return 0;
}
