#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, cnt = 0, x, j = 0;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    a[i] = a[i] - 1;
  }
  x = a[0];
  for (int i = 0; i < n; i++) {
    if (x < a[i]) x = a[i];
    if (a[i] >= x && i == a[i]) {
      cnt++;
    }
  }
  cout << cnt;
  return 0;
}
