#include <bits/stdc++.h>
using namespace std;
const int inf = 1000000005;
int main() {
  cin.sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<int> mx(n + 2), mn(n + 2);
  mx[0] = 0;
  mn[n + 1] = inf;
  vector<int> a(n + 2);
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    mx[i] = max(mx[i - 1], a[i]);
  }
  for (int i = n; i >= 1; i--) {
    mn[i] = min(mn[i + 1], a[i]);
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    if (mx[i] <= mn[i + 1]) {
      ans++;
    }
  }
  cout << ans << "\n";
  return 0;
}
