#include <bits/stdc++.h>
using namespace std;
struct debugger {
  template <typename T>
  debugger& operator,(const T v) {
    cerr << v << " ";
    return *this;
  }
} dbg;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, a, mx = 1, ans = 0;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a;
    mx = max(a, mx);
    if (mx == i + 1) {
      ans++;
    }
  }
  cout << ans << "\n";
  return 0;
}
