#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int cou = 0;
  int now = 0;
  for (long long(i) = (0); (i) < (n); ++i) {
    int a;
    cin >> a;
    a--;
    now = max(now, a);
    if (now <= i) cou++;
  }
  cout << cou << endl;
  return 0;
}
