#include <bits/stdc++.h>
using namespace std;
vector<long long int> org, sor;
long long int arr[100005] = {};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int n, x, cunt = 0;
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> x, org.push_back(x);
  sor = org;
  sort(sor.begin(), sor.end());
  for (int i = 0; i < n; ++i) {
    arr[i + 1] = (org[i] - sor[i]) + arr[i];
    if (!arr[i + 1]) ++cunt;
  }
  cout << cunt;
  return 0;
}
