#include <bits/stdc++.h>
const int N = 1e6;
const double PI = 3.14;
using namespace std;
int n, m, k, a[N], mx, sum;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    mx = max(a[i], mx);
    if (i == mx) sum++;
  }
  cout << sum;
  return 0;
}
