#include <bits/stdc++.h>
using namespace std;
const int N = 1e4;
int n, a[N];
template <typename T>
void read(T& x) {
  x = 0;
  char c = getchar();
  bool f = 0;
  while (!isdigit(c) && c != '-') c = getchar();
  if (c == '-') f = 1, c = getchar();
  while (isdigit(c)) x = x * 10 + c - '0', c = getchar();
  if (f) x = -x;
}
int main() {
  ios::sync_with_stdio(false);
  read(n);
  for (int i = 1; i <= n; i++) {
    read(a[i]);
  }
  int maxi = a[1], day = 0;
  for (int i = 1; i <= n; i++) {
    maxi = max(maxi, a[i]);
    if (maxi == i) {
      day++;
    }
  }
  cout << day;
  return 0;
}
