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