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