#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
int a[maxn], now = 1, n, book[maxn], ans;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
  }
  while (now <= n) {
    ans++;
    if (now > n) break;
    int la = a[now];
    for (int i = now; i <= la; ++i) {
      la = max(la, a[i]);
    }
    now = la + 1;
  }
  cout << ans << "\n";
  return 0;
}
