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