#include <bits/stdc++.h>
using namespace std;
void IO() {
  mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int main() {
  IO();
  long long int n;
  cin >> n;
  vector<long long int> arr(n);
  for (__typeof(n) i = (0) - ((0) > (n)); i != (n) - ((0) > (n));
       i += 1 - 2 * ((0) > (n))) {
    cin >> arr[i];
  }
  long long int ans = 0;
  long long int mm = 0;
  for (__typeof(n) i = (0) - ((0) > (n)); i != (n) - ((0) > (n));
       i += 1 - 2 * ((0) > (n))) {
    mm = max(mm, arr[i]);
    if (mm == i + 1) {
      ans++;
    }
  }
  cout << ans << "\n";
  return 0;
}
