#include <bits/stdc++.h>
using namespace std;
int dx[] = {-1, 0, 1, 0, -1, -1, 1, 1};
int dy[] = {0, 1, 0, -1, -1, 1, -1, 1};
int vis[11001];
int main() {
  long long int n, m, k;
  cin >> n;
  int a[n + 1];
  for (int i = 1; i <= n; i++) cin >> a[i];
  long long int cnt = 0;
  for (int i = 1; i <= n; i++) {
    cnt++;
    queue<int> q;
    q.push(i);
    vis[i] = 1;
    int te = a[i];
    for (int j = i; j <= te; j++) {
      te = max(te, a[j]);
    }
    i = te;
  }
  cout << cnt << endl;
  return 0;
}
