#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
bool vis[N];
int a[N], n;
void read(int x) {
  if (vis[x]) return;
  vis[x] = 1;
  for (int i = x; i <= a[x]; i++) read(i);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  int ans = 0;
  for (int i = 1; i <= n; i++)
    if (!vis[i]) {
      ans++;
      read(i);
    }
  printf("%d\n", ans);
}
