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