#include <bits/stdc++.h>
using namespace std;
int arr[10001];
int main() {
  int N;
  cin >> N;
  for (int i = 0; i < N; i++) cin >> arr[i];
  int cur = -1;
  int maxRead = 0;
  int days = 0;
  while (cur < N) {
    days += 1;
    cur += 1;
    maxRead = arr[cur];
    while (cur + 1 < maxRead) {
      cur += 1;
      maxRead = max(maxRead, arr[cur]);
    }
  }
  cout << (days - 1) << endl;
}
