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