#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void read(T &val) {
  val = 0;
  int f = 1;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    val = (val << 3) + (val << 1) + (c ^ 48);
    c = getchar();
  }
  val *= f;
}
const int N = 10005;
int n, a[N];
int main() {
  read(n);
  for (int i = 1; i <= n; i++) read(a[i]);
  int ans = 0;
  for (int now = 1; now <= n; now++) {
    ans++;
    int maxx = a[now];
    while (now < maxx) {
      now++;
      maxx = max(maxx, a[now]);
    }
  }
  cout << ans << endl;
  return 0;
}
