#include <bits/stdc++.h>
using namespace std;
const int MOD = 998244353;
const long long INF = 3e9 + 7;
const int base = 1e9;
const int MAX = 1e6 + 2;
const double EPS = 1e-9;
const double PI = acos(-1.);
int main() {
  int n;
  cin >> n;
  vector<int> v(n + 1);
  for (int i = 1; i <= n; i++) {
    cin >> v[i];
  }
  int last = 0, res = 0;
  for (int i = 1; i <= n; i++) {
    if (v[i] > last) last = v[i];
    if (i == last) {
      res++;
    }
  }
  cout << res;
  return 0;
}
