#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7, MAXN = 2e5 + 5;
int T, N, M, K, Q, A[MAXN], B[MAXN];
string S;
int gcd(int a, int b) { return !b ? a : gcd(b, a % b); }
void fillA() {
  for (int i = 0; i < N; ++i) cin >> A[i];
}
long long fast_pow(long long b, long long e) {
  long long ans = 1;
  while (e > 0) {
    if (e & 1) ans = (ans * b) % MOD;
    e >>= 1;
    b = (b * b) % MOD;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  cin >> N;
  for (int i = 1; i < N + 1; ++i) cin >> A[i];
  int lastp = 1, days = 0, i = 1;
  while (i < N + 1) {
    lastp = max(lastp, A[i]);
    if (i >= lastp) days++, lastp++;
    i++;
  }
  cout << days;
  return 0;
}
