#include <bits/stdc++.h>
using namespace std;
long long gcd(long long n1, long long n2) {
  if (!n1) return n2;
  if (!n2) return n1;
  if (n1 % n2 == 0) return n2;
  return gcd(n2, n1 % n2);
}
long long powmod(long long base, long long exponent) {
  long long ans = 1;
  while (exponent) {
    if (exponent & 1) ans = (ans * base) % 1000000007;
    base = (base * base) % 1000000007;
    exponent /= 2;
  }
  return ans;
}
int arr[1000100 + 1];
int pre[1000100 + 1];
int suf[1000100 + 1];
int main() {
  int i, j, k, n, answer = 0;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%d", &arr[i]);
  suf[n + 1] = 1000000100;
  for (i = 1; i <= n; i++) pre[i] = max(pre[i - 1], arr[i]);
  for (i = n; i >= 1; i--) suf[i] = min(suf[i + 1], arr[i]);
  for (i = 1; i <= n; i++)
    if (pre[i] <= suf[i + 1]) answer++;
  printf("%d", answer);
  return 0;
}
