#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  long long int n, i, a[10004], m = 0, ans = 0;
  cin >> n;
  for (i = 1; i <= n; i++) cin >> a[i];
  for (i = 1; i <= n; i++) {
    m = max(a[i], m);
    if (m <= i) {
      ans++;
      m = 0;
    }
  }
  cout << ans;
  return 0;
}
