#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  long long r;
  while (b != 0) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
const int MOD = (int)1e9 + 7;
const int INF = (int)1e9;
const long long LINF = (long long)1e18;
const long double PI = 2 * acos(0);
const int maxn = 100010;
int n;
int h[maxn];
int d[maxn];
void solve() {
  scanf("%d", &n);
  for (int i = (0); i < (n); i++) scanf("%d", h + i);
  d[n] = 2 * INF;
  for (int i = (n)-1; i >= (0); i--) d[i] = min(d[i + 1], h[i]);
  int ans = 0;
  for (int i = (0); i < (n); i++) {
    ans++;
    int cur = i, dmax = h[i];
    while (cur < n - 1 && dmax > d[cur + 1]) dmax = max(dmax, h[++cur]);
    i = cur;
  }
  printf("%d", ans);
}
int main() {
  solve();
  return 0;
}
