#include <bits/stdc++.h>
using namespace std;
template <typename R, typename D>
inline void Min(R &a, D b) {
  if (a > b) a = b;
}
template <typename D, typename R>
inline void Max(D &a, R b) {
  if (a < b) a = b;
}
const long long mod = 1e9 + 7;
const int maxn = 300005;
int n, dem;
pair<int, int> a[maxn];
bool cmp(pair<int, int> a, pair<int, int> b) {
  if (a.first == b.first) return a.second < b.second;
  return a.first < b.first;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i].first, a[i].second = i;
  sort(a + 1, a + n + 1);
  int last = 0;
  for (int i = 1; i <= n; i++) {
    Max(last, a[i].second);
    if (last == i) dem++;
  }
  cout << dem;
}
