#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, arr[10010], pivot, temp, cnt = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  pivot = 0;
  while (pivot < n) {
    int furthest = pivot;
    for (int i = pivot; i < n; i++) {
      temp = arr[i];
      furthest = max(temp, furthest);
      if (i + 1 >= furthest) {
        pivot = i + 1;
        break;
      }
    }
    cnt++;
  }
  cout << cnt << '\n';
  return 0;
}
