#include <bits/stdc++.h>
using namespace std;
int N;
int a[100005];
int main() {
  int i, j, k;
  cin >> N;
  for (i = 1; i <= N; i++) {
    cin >> a[i];
  }
  int last = 0, ans = 0;
  for (i = 1; i <= N; i++) {
    last = max(last, a[i]);
    if (i == last) {
      ans++;
    }
  }
  cout << ans << endl;
}
