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