#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 1e6 + 5;
int a[N], b[N];
int main() {
  ios ::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  b[n + 1] = 1e9 + 7;
  for (int i = n; i >= 1; i--) b[i] = min(a[i], b[i + 1]);
  int cur_max = 0;
  int res = 0;
  for (int i = 1; i <= n; ++i) {
    cur_max = max(cur_max, a[i]);
    if (cur_max <= b[i + 1]) ++res;
  }
  cout << res;
  return 0;
}
