#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e4 + 233;
int n, f[maxn], vis[maxn];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) scanf("%d", &f[i]);
  int ans = 0;
  int t = 0;
  for (int i = 1; i <= n; i = t + 1) {
    t = f[i];
    for (int j = i; j <= t; j++) {
      if (f[j] > t) t = f[j];
    }
    ans++;
  }
  cout << ans;
}
