#include <bits/stdc++.h>
using namespace std;
const int N = 1e4 + 1000;
int main(void) {
  int n, a[N];
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  int last = 0, j = 0;
  int ans = 0;
  while (j < n) {
    ans++;
    last = j;
    for (int i = j; i <= last; ++i) {
      ++j;
      last = max(last, a[i] - 1);
    }
  }
  cout << ans << endl;
  return 0;
}
