#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long i, j, q, f, k, a, b, c, x, y, z, flag = 0, ans = 0, t, n, m;
  q = 1;
  while (q--) {
    cin >> n;
    vector<long long> v(n + 1);
    long long maxx = -1, ans = 0;
    for (i = 1; i <= n; i++) {
      cin >> v[i];
      if (v[i] > maxx) {
        maxx = v[i];
      }
      if (maxx <= i) {
        ans++;
      }
    }
    cout << ans;
  }
  return 0;
}
