#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e6;
int main() {
  int n;
  cin >> n;
  int a[n + 2];
  for (int i = 1; i <= n; i++) cin >> a[i];
  int cur, cnt = 0;
  if (n == 1)
    cnt = 1;
  else {
    for (int i = 2; i <= n; i++) a[i] = max(a[i], a[i - 1]);
    cur = 0;
    for (int i = 1; i <= n; i++) {
      while (cur < a[i] && i <= n) cur = a[i], i = a[i];
      cnt++;
    }
  }
  cout << cnt << endl;
}
