#include <bits/stdc++.h>
using namespace std;
int maxElement(int arr[], int n) {
  int maxi = arr[0];
  for (int i = 1; i < n; i++) {
    if (arr[i] > maxi) maxi = arr[i];
  }
  return maxi;
}
int minElement(int arr[], int n) {
  int mini = arr[0];
  for (int i = 1; i < n; i++) {
    if (arr[i] < mini) mini = arr[i];
  }
  return mini;
}
string trim(const string& str) {
  size_t first = str.find_first_not_of(' ');
  if (string::npos == first) {
    return str;
  }
  int last = str.find_last_not_of(' ');
  return str.substr(first, (last - first + 1));
}
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  int arr[n + 1];
  for (int i = 1; i <= n; i++) {
    cin >> arr[i];
  }
  int maxi = arr[1];
  long long int c = 0;
  int need = 0;
  for (int i = 2; i <= n; i++) {
    while (i <= maxi && i <= n) {
      if (arr[i] > maxi) {
        maxi = arr[i];
      }
      i++;
    }
    if (i <= n) maxi = max(arr[i], maxi);
    c++;
    need = i;
  }
  if (need <= n) {
    c++;
  }
  cout << c << '\n';
  cerr << "Time elapsed" << 1.0 * clock() / CLOCKS_PER_SEC << "s\n";
  return 0;
}
