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