#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> values(n);
  for (int i = 0; i < n; ++i) {
    cin >> values[i];
  }
  vector<int> qwe(n);
  qwe[0] = values[0];
  for (int i = 1; i < n; ++i) {
    qwe[i] = max(qwe[i - 1], values[i]);
  }
  int count = 0;
  for (int i = 0; i < n; ++i) {
    if (qwe[i] == i + 1) {
      count += 1;
    }
  }
  cout << count << "\n";
  return 0;
}
