#include <bits/stdc++.h>
using namespace std;
const int N = 10000;
int main() {
  int n, mas[N] = {0};
  cin >> n;
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    cin >> mas[i];
  }
  for (int i = 1; i <= n;) {
    cnt++;
    int temp = i;
    while (i <= n && i <= temp) {
      temp = max(temp, mas[i]);
      i++;
    }
  }
  cout << cnt;
  return 0;
}
