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