#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e4 + 10;
int n;
int arr[maxn];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  for (register int i = 1; i <= n; ++i) cin >> arr[i];
  int cnt = 0, cur = 0;
  for (register int i = 1; i <= n; ++i) {
    cur = max(cur, arr[i]);
    if (i >= cur) cnt++;
  }
  cout << cnt << endl;
  return 0;
}
