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