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