#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
double PI = 4 * atan(1);
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  int mys[100000] = {};
  for (int i = 1; i < n + 1; i++) {
    cin >> mys[i];
  }
  int curr = 1;
  int days = 0;
  int currmys = mys[1];
  while (curr <= n) {
    currmys = mys[curr];
    while (curr <= n && currmys > curr) {
      curr += 1;
      currmys = max(currmys, mys[curr]);
    }
    curr += 1;
    days += 1;
  }
  cout << days;
}
