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