#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, cnt = 0;
  cin >> n;
  int a[n], i, j;
  for (i = 0; i < n; ++i) cin >> a[i];
  if (n == 1) {
    cout << "1";
  } else {
    for (i = 0; i < n; ++i) {
      if (a[i] == i + 1) {
        for (j = i - 1; j >= 0; --j) {
          if (a[j] > a[i]) break;
        }
        if (j < 0) cnt++;
      }
    }
    cout << cnt;
  }
  return 0;
}
