#include <bits/stdc++.h>
using namespace std;
mt19937 rng((int)std::chrono::steady_clock::now().time_since_epoch().count());
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<int> a(n);
  for (auto &x : a) cin >> x, x--;
  int ans = 0;
  for (int i = 0; i < n;) {
    int run = a[i];
    for (int j = i; j <= run; j++) {
      run = max(run, a[j]);
      i = j + 1;
    }
    ans++;
  }
  cout << ans << endl;
}
