#include <bits/stdc++.h>
using namespace std;
vector<vector<int64_t>> v(100005, vector<int64_t>(2));
bool pd(vector<int64_t> a, vector<int64_t> b) {
  if (a[0] < b[0]) return true;
  if (b[0] < a[0]) return false;
  return a[1] < b[1];
}
int64_t fnc(int n) {
  sort(v.begin(), v.begin() + n, pd);
  int64_t mx = -1, ct = 0;
  for (int i = 0; i < n; i++) {
    mx = max(mx, v[i][1]);
    if (i == mx) {
      ct++;
      mx = -1;
    }
  }
  return ct;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int m;
  cin >> m;
  for (int i = 0; i < m; i++) {
    cin >> v[i][0];
    v[i][1] = i;
  }
  cout << fnc(m) << endl;
  return 0;
}
