#include <bits/stdc++.h>
using namespace std;
long long int a[500001];
int main() {
  long long int h, i, j, n, s = 0;
  cin >> n;
  for (i = 1; i <= n; i++) cin >> a[i];
  for (i = 1; i <= n;) {
    j = i;
    long long int m = a[i];
    s++;
    while (j <= m) {
      if (a[j] > m) {
        m = a[j];
      }
      j++;
    }
    i = j;
  }
  cout << s;
  return 0;
}
