#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (a % b == 0) {
    return b;
  } else {
    return gcd(b, a % b);
  }
}
long long powc(long long a, long long b) {
  if (b < 0) {
    return -1;
  }
  long long res = 1;
  while (b > 0) {
    if (b & 1) {
      res *= a;
    }
    a *= a;
    res %= 1000000007, a %= 1000000007;
    b >>= 1;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  vector<long long> v(n);
  for (long long i = 0; i < n; ++i) {
    cin >> v[i];
  }
  long long i = 0;
  long long day = 0;
  set<long long, greater<long long> > s;
  long long mx = 0;
  while (i < n) {
    day++;
    mx = max(mx, v[i]);
    while (i + 1 <= mx) {
      mx = max(mx, v[i]);
      i++;
    }
  }
  cout << day;
}
