#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
template <typename T>
using vv = vector<vector<T>>;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  multiset<long long> from;
  multiset<long long> to;
  int n;
  cin >> n;
  vector<long long> v(n);
  for (int i = 0; i < n; ++i) {
    cin >> v[i];
    from.insert(v[i]);
  }
  from.insert((*from.rbegin()) + 1);
  ll res = 0;
  for (auto elem : v) {
    from.erase(from.find(elem));
    to.insert(elem);
    if (*from.begin() >= *to.rbegin()) {
      ++res;
    }
  }
  cout << res << endl;
}
