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