#include <bits/stdc++.h>
using namespace std;
const long long INF = 200000000000000000LL;
const long double EPS = 1e-9;
const int inf = 0x3f3f3f3f;
const int N = 1e4 + 7;
int a[N], c[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int n;
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  for (int i = 1; i <= n; ++i) {
    ++c[i];
    --c[a[i]];
  }
  int res = 0, car = 0;
  for (int i = 1; i <= n; ++i) {
    car += c[i];
    if (!car) ++res;
  }
  cout << res << "\n";
  return 0;
}
