#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int max = 0;
  int cur = 0;
  int cnt = 0;
  for (int i = 1; i <= n; ++i) {
    cin >> cur;
    if (cur > max) {
      max = cur;
    }
    if (i == max) {
      cnt++;
    }
  }
  cout << cnt << endl;
  return 0;
}
