#include <bits/stdc++.h>
template <typename A, typename B>
inline void umin(A &x, B y) {
  if (x > y) x = y;
}
template <typename A, typename B>
inline void umax(A &x, B y) {
  if (x < y) x = y;
}
const int MAXN = 300005;
using namespace std;
int n, ans;
int A[MAXN], mn[MAXN];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> A[i];
    mn[i] = A[i];
  }
  mn[n + 1] = 1000000000;
  for (int i = n - 1; i > 0; i--) umin(mn[i], mn[i + 1]);
  for (int i = 1; i <= n; i++) umax(A[i], A[i - 1]);
  for (int i = 1; i <= n; i++)
    if (A[i] <= mn[i + 1]) ans++;
  cout << ans;
}
