#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, b;
  cin >> n;
  vector<int> a;
  for (long long i = 0; i < n; i++) {
    cin >> b;
    a.push_back(b);
    a[i]--;
  }
  int cnt = 0, pos = 0;
  while (pos < n) {
    cnt++;
    int mx = pos;
    while (pos < n && pos <= mx) {
      mx = max(mx, a[pos]);
      pos++;
    }
  }
  cout << cnt << endl;
  return 0;
}
