#include <bits/stdc++.h>
using namespace std;
map<int, int> ma;
int main(void) {
  int i, j, n, m, all, cnt;
  scanf("%d", &n);
  cnt = 0;
  all = 0;
  for (i = 1; i <= n; i++) {
    scanf("%d", &m);
    ma[m]++;
    all++;
    if (ma[i]) all -= ma[i];
    if (all == 0) cnt++;
  }
  cout << cnt << endl;
}
