#include <bits/stdc++.h>
using namespace std;
long long n, m, a[100000], mxsuf[100000], mnsuf[100000], mxpref[100000],
    mnpref[100000], ans, mx, mn, mxp, mnp;
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  mnsuf[n] = 1000000000;
  mxsuf[n - 1] = a[n - 1];
  mnsuf[n - 1] = a[n - 1];
  for (int i = n - 2; i >= 0; i--) {
    mxsuf[i] = max(mxsuf[i + 1], a[i]);
    mnsuf[i] = min(mnsuf[i + 1], a[i]);
  }
  mxpref[0] = a[0];
  mnpref[0] = a[0];
  for (int i = 1; i < n; ++i) {
    mxpref[i] = max(mxpref[i - 1], a[i]);
    mnpref[i] = min(mnpref[i - 1], a[i]);
  }
  mx = a[0];
  mn = a[0];
  mxp = 0;
  for (int i = 1; i <= n; ++i) {
    if (mx <= mnsuf[i] && mn >= mxp) {
      ans++;
      mxp = mx;
      mx = a[i];
      mn = a[i];
    }
    mx = max(mx, a[i]);
    mn = min(mn, a[i]);
  }
  cout << ans;
}
