#include <bits/stdc++.h>
using namespace std;
int a[int(1e4 + 7)];
int n;
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  int cnt = 0;
  int m = -1;
  for (int i = 1; i <= n; ++i) {
    m = max(m, a[i]);
    if (i == m) cnt++;
  }
  cout << cnt;
  return 0;
}
