#include <bits/stdc++.h>
using namespace std;
int a[1000005];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  int Max = 0;
  int Ans = 0;
  for (int i = 1; i <= n; i++) {
    Max = max(Max, a[i]);
    if (Max == i) Ans++;
  }
  cout << Ans << endl;
}
