#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int arr[10005];
  cin >> n;
  int count = 0;
  int curr = 0;
  for (int i = 1; i <= n; ++i) {
    cin >> arr[i];
    curr = max(arr[i], curr);
    if (curr == i) {
      ++count;
    }
  }
  cout << count;
}
