#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int a[10005];
  int i;
  cin >> n;
  for (i = 1; i <= n; i++) cin >> a[i];
  int maxx = a[1];
  int sum = 0;
  for (i = 1; i <= n; i++) {
    if (a[i] > maxx) maxx = a[i];
    if (i == maxx) sum++;
  }
  cout << sum << endl;
  return 0;
}
