#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, count = 0, input, temp;
  vector<int> pages;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> input;
    pages.push_back(input);
  }
  temp = pages[0];
  for (int i = 0; i < n; i++) {
    if (pages[i] >= temp) temp = pages[i];
    if (temp == i + 1) count++;
  }
  cout << count << endl;
}
