#include <bits/stdc++.h>
using namespace std;
long long a[100005], b[100005];
map<long long, vector<long long>> p;
map<long long, long long> c;
int main() {
  long long n;
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
    b[i] = a[i];
  }
  sort(b + 1, b + 1 + n);
  for (long long i = 1; i <= n; i++) {
    p[b[i]].push_back(i);
  }
  long long mx = 0, num = 0;
  for (long long i = 1; i <= n; i++) {
    mx = max(mx, p[a[i]][c[a[i]]]);
    c[a[i]]++;
    if (mx == i) num++, mx = 0;
  }
  cout << num << endl;
}
