#include <bits/stdc++.h>
using namespace std;
struct sth {
  int v, w;
} a[100001];
int n, i, ans, maxh;
int pl[100001];
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
inline void write(int x) {
  if (x == 0) {
    putchar('0');
    return;
  }
  if (x < 0) putchar('-'), x = -x;
  int len = 0, buf[15];
  while (x) buf[len++] = x % 10, x /= 10;
  for (int i = len - 1; i >= 0; i--) putchar(buf[i] + '0');
  return;
}
bool comp(sth x, sth y) {
  if (x.v != y.v)
    return x.v < y.v;
  else
    return x.w < y.w;
}
int main() {
  std::ios::sync_with_stdio(false);
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i].v);
    a[i].w = i;
  }
  sort(a + 1, a + n + 1, comp);
  for (i = 1; i <= n; i++) {
    if (a[i].w > i)
      pl[a[i].w] = 1;
    else
      ans++;
    ans += pl[i];
    if (ans == i) maxh++;
  }
  printf("%d", maxh);
  return 0;
}
