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