#include <bits/stdc++.h>
const int N = 1000007, inf = 0x3f3f3f3f;
using namespace std;
int v[N], nxt[N];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> v[i];
  nxt[n] = v[n];
  for (int i = n - 1; i > 0; --i) {
    nxt[i] = v[i];
    for (int j = i + 1; j <= v[i]; ++j) nxt[i] = max(nxt[i], nxt[j]);
  }
  int cnt = 0;
  for (int cur = 1; cur <= n; cur = nxt[cur] + 1) cnt++;
  cout << cnt << endl;
}
