#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
    int x, t = 1, day = 0;
    for (int i = 1; i <= n; i++) {
      cin >> x;
      if (x > t) t = x;
      if (i == t) day++;
    }
    cout << day << endl;
  }
  return 0;
}
