#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d = 0, x = 0;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    int a;
    cin >> a;
    x = max(x, a);
    if (x == i) ++d;
  }
  cout << d;
  return 0;
}
